質問編集履歴
1
コードの追加
title
CHANGED
|
@@ -1,1 +1,1 @@
|
|
|
1
|
-
CSS コンテンツ内移動
|
|
1
|
+
CSS /コンテンツ内を移動させるときにほぼ全てpositionを使う間違い/divタグの多用
|
body
CHANGED
|
@@ -1,2 +1,197 @@
|
|
|
1
|
-
cssでコードを打つとき、レイアウトの配置でコンテンツ内を移動させるためほぼ全てpositionを使いまくってしまうのですがこのやり方は間違っている気がします。
|
|
2
|
-
また、
|
|
1
|
+
cssでコードを打つとき、レイアウトの配置でコンテンツ内を移動させるためほぼ全てpositionを使いまくってしまうのですがこのやり方は間違っている気がします。どんなプロパティを使用してコーディングしたらいいのでしょうか。
|
|
2
|
+
また、divタグを多用してしまい、divタグだらけのコードになっていまいます。どんな時にdivタグを使わないのかなど教えていただきたいです。よろしくお願いします。
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
<div class="h2_2">
|
|
6
|
+
<h2>万一の時も安心です</h2>
|
|
7
|
+
<p>大切なお家にお迎えする相手選びは、信頼第一で進めたいですよね。 その思いに応えるため、Airbnbでは宿泊者に求める厳格な要件をホスト自身の手で設定し、滞在前にお互い交流できるシステムを採用しています。 万一のトラブルのときには、Airbnbが全力でサポートします。 建物・家財の被害は「ホスト保証」、賠償責任は「ホスト補償保険」でカバー。ホストのみなさまのあらゆるシチュエーションに対処しています。</p>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="h2_2bottom">
|
|
10
|
+
<a href="#">ホストをお守りするしくみを見る</a>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="h2_2_1">
|
|
14
|
+
<span>予約前に政府発行の身分証明書を求める権限</span>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="h2_2_2">
|
|
17
|
+
<span>ハウスルールに同意しないと泊まれない</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="h2_2_3">
|
|
20
|
+
<span>過去の宿泊のレビューもばっちり読める</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="h2_2_4">
|
|
23
|
+
<span>財物損害は¥100,000,000まで無料で補償</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="h2_2_5">
|
|
26
|
+
<span>$1,000,000の賠償責任保険が無料で付帯</span>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="h2_2_6">
|
|
29
|
+
<span>24時間365日対応グローバルカスタマーサポート</span>
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
```
|
|
33
|
+
.h2_2{
|
|
34
|
+
position:relative;
|
|
35
|
+
top:460px;
|
|
36
|
+
text-align:center;
|
|
37
|
+
font-size:60px;
|
|
38
|
+
color:#2B2B2B;
|
|
39
|
+
margin:300px;
|
|
40
|
+
}
|
|
41
|
+
.h2_2 h2::before{
|
|
42
|
+
position:absolute;
|
|
43
|
+
content:"";
|
|
44
|
+
width:60px;
|
|
45
|
+
height:2px;
|
|
46
|
+
top:-15px;
|
|
47
|
+
left:50%;
|
|
48
|
+
background-color:#636262;
|
|
49
|
+
transform:translateX(-50%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.h2_2 p{
|
|
53
|
+
position:absolute;
|
|
54
|
+
text-align:left;
|
|
55
|
+
font-size:18px;
|
|
56
|
+
color:#4E4D4D;
|
|
57
|
+
line-height:1.5;
|
|
58
|
+
right:700px;
|
|
59
|
+
top:180px;
|
|
60
|
+
width:479px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.h2_2bottom{
|
|
64
|
+
position:relative;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.h2_2bottom a{
|
|
68
|
+
position:absolute;
|
|
69
|
+
font-size:18px;
|
|
70
|
+
top:520px;
|
|
71
|
+
left:423px;
|
|
72
|
+
color:#2DBC96;
|
|
73
|
+
text-decoration:none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.h2_2bottom a:hover{
|
|
77
|
+
text-decoration:underline;
|
|
78
|
+
}
|
|
79
|
+
.h2_2_1,.h2_2_2,.h2_2_3,.h2_2_4,.h2_2_5,.h2_2_6{
|
|
80
|
+
position:relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.h2_2_1 span{
|
|
84
|
+
position:absolute;
|
|
85
|
+
top:270px;
|
|
86
|
+
font-size:18px;
|
|
87
|
+
left:1000px;
|
|
88
|
+
color:#4E4D4D;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.h2_2_2 span{
|
|
92
|
+
position:absolute;
|
|
93
|
+
font-size:18px;
|
|
94
|
+
left:1000px;
|
|
95
|
+
top:310px;
|
|
96
|
+
color:#4E4D4D;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.h2_2_3 span{
|
|
100
|
+
position:absolute;
|
|
101
|
+
font-size:18px;
|
|
102
|
+
left:1000px;
|
|
103
|
+
top:350px;
|
|
104
|
+
color:#4E4D4D;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.h2_2_4 span{
|
|
108
|
+
position:absolute;
|
|
109
|
+
font-size:18px;
|
|
110
|
+
left:1000px;
|
|
111
|
+
top:390px;
|
|
112
|
+
color:#4E4D4D;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.h2_2_5 span{
|
|
116
|
+
position:absolute;
|
|
117
|
+
font-size:18px;
|
|
118
|
+
left:1000px;
|
|
119
|
+
top:430px;
|
|
120
|
+
color:#4E4D4D;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.h2_2_6 span{
|
|
124
|
+
position:absolute;
|
|
125
|
+
font-size:18px;
|
|
126
|
+
left:1000px;
|
|
127
|
+
top:470px;
|
|
128
|
+
color:#4E4D4D;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
.h2_2_1 span::before{
|
|
133
|
+
position:absolute;
|
|
134
|
+
content:"";
|
|
135
|
+
border-right:2px solid #2DBC96;
|
|
136
|
+
border-bottom:2px solid #2DBC96;
|
|
137
|
+
width:5px;
|
|
138
|
+
height:13px;
|
|
139
|
+
transform:rotate(45deg);
|
|
140
|
+
left:-20px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.h2_2_2 span::before{
|
|
144
|
+
position:absolute;
|
|
145
|
+
content:"";
|
|
146
|
+
border-right:2px solid #2DBC96;
|
|
147
|
+
border-bottom:2px solid #2DBC96;
|
|
148
|
+
width:5px;
|
|
149
|
+
height:13px;
|
|
150
|
+
transform:rotate(45deg);
|
|
151
|
+
left:-20px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.h2_2_3 span::before{
|
|
155
|
+
position:absolute;
|
|
156
|
+
content:"";
|
|
157
|
+
border-right:2px solid #2DBC96;
|
|
158
|
+
border-bottom:2px solid #2DBC96;
|
|
159
|
+
width:5px;
|
|
160
|
+
height:13px;
|
|
161
|
+
transform:rotate(45deg);
|
|
162
|
+
left:-20px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.h2_2_4 span::before{
|
|
166
|
+
position:absolute;
|
|
167
|
+
content:"";
|
|
168
|
+
border-right:2px solid #2DBC96;
|
|
169
|
+
border-bottom:2px solid #2DBC96;
|
|
170
|
+
width:5px;
|
|
171
|
+
height:13px;
|
|
172
|
+
transform:rotate(45deg);
|
|
173
|
+
left:-20px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.h2_2_5 span::before{
|
|
177
|
+
position:absolute;
|
|
178
|
+
content:"";
|
|
179
|
+
border-right:2px solid #2DBC96;
|
|
180
|
+
border-bottom:2px solid #2DBC96;
|
|
181
|
+
width:5px;
|
|
182
|
+
height:13px;
|
|
183
|
+
transform:rotate(45deg);
|
|
184
|
+
left:-20px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.h2_2_6 span::before{
|
|
188
|
+
position:absolute;
|
|
189
|
+
content:"";
|
|
190
|
+
border-right:2px solid #2DBC96;
|
|
191
|
+
border-bottom:2px solid #2DBC96;
|
|
192
|
+
width:5px;
|
|
193
|
+
height:13px;
|
|
194
|
+
transform:rotate(45deg);
|
|
195
|
+
left:-20px;
|
|
196
|
+
}
|
|
197
|
+
```
|