teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

追記

2017/06/29 17:13

投稿

s8_chu
s8_chu

スコア14731

answer CHANGED
@@ -35,4 +35,87 @@
35
35
  </div>
36
36
  </body>
37
37
  </html>
38
+ ```
39
+
40
+ 追記
41
+ ---
42
+ ```HTML
43
+ <!DOCTYPE html>
44
+ <html lang="ja">
45
+ <head>
46
+ <meta charset="UTF-8">
47
+ <title>タイトル</title>
48
+ <style type="text/css">
49
+ * {
50
+ margin: 0;
51
+ padding: 0;
52
+ }
53
+
54
+ html,
55
+ body {
56
+ width: 100%;
57
+ height: 100%;
58
+ }
59
+
60
+ span {
61
+ font-size: 1.5em;
62
+ color: #fff;
63
+ }
64
+
65
+ .background {
66
+ position: fixed;
67
+ z-index: 0;
68
+ top: 0;
69
+ left: 0;
70
+ width: 100%;
71
+ height: 100%;
72
+ }
73
+
74
+ .content1 {
75
+ position: relative;
76
+ z-index: 2;
77
+ height: 100%;
78
+ color: #fff;
79
+ background-color: rgba(255, 255, 255, .3);
80
+ }
81
+
82
+ .content2 {
83
+ position: relative;
84
+ z-index: 3;
85
+ height: 500px;
86
+ background-color: #fff;
87
+ }
88
+
89
+ .image1 {
90
+ position: absolute;
91
+ z-index: 0;
92
+ top: 0;
93
+ left: 0;
94
+ width: 100%;
95
+ height: 100%;
96
+ }
97
+
98
+ .footer1 {
99
+ position: relative;
100
+ z-index: 3;
101
+ height: 500px;
102
+ background-color: rgba(255, 255, 255, .3);
103
+ }
104
+ </style>
105
+ </head>
106
+ <body>
107
+ <div class="background">
108
+ <img class="image1" src="https://placehold.jp/3d4070/ffffff/500x500.png?text=image" alt="image">
109
+ </div>
110
+ <section class="content1">
111
+ <h1>テキスト</h1>
112
+ </section>
113
+ <section class="content2">
114
+ <h1>テキストテキスト</h1>
115
+ </section>
116
+ <footer class="footer1">
117
+ <span>テキストテキストテキスト</span>
118
+ </footer>
119
+ </body>
120
+ </html>
38
121
  ```

1

修正

2017/06/29 17:13

投稿

s8_chu
s8_chu

スコア14731

answer CHANGED
@@ -7,16 +7,20 @@
7
7
  <title>タイトル</title>
8
8
  <style type="text/css">
9
9
  html {
10
- background: url(https://placehold.jp/3d4070/ffffff/500x500.png?text=image) no-repeat center center fixed;
10
+ background: url(https://placehold.jp/3d4070/ffffff/500x500.png?text=image);
11
- -webkit-background-size: cover;
11
+ -webkit-background-size: 100% 100%;
12
- -moz-background-size: cover;
12
+ -moz-background-size: 100% 100%;
13
- -o-background-size: cover;
13
+ -o-background-size: 100% 100%;
14
- background-size: cover;
14
+ background-size: 100% 100%;
15
15
  }
16
16
 
17
- h1, p {
17
+ h1, h2, p {
18
18
  color: #ffffff;
19
19
  }
20
+
21
+ .big {
22
+ height: 5000px;
23
+ }
20
24
  </style>
21
25
  </head>
22
26
  <body>
@@ -24,6 +28,11 @@
24
28
  <h1>テキスト</h1>
25
29
  <p>テキストテキストテキストテキスト</p>
26
30
  </div>
31
+ <div class="big">
32
+ <h2>テキスト</h2>
33
+ <p>テキストテキストテキストテキスト</p>
34
+
35
+ </div>
27
36
  </body>
28
37
  </html>
29
38
  ```