質問編集履歴

2

図を詳細にしました。

2019/06/29 07:50

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  以下の画像のように作っています。
12
12
 
13
- オレンジ色がdiv、緑色がh4、青がFlexアイテムとなっています。
13
+ 黒枠がページ幅、オレンジ色がdiv、緑色がh4、青がFlexコンテナ、紫がFlexアイテムとなっています。
14
14
 
15
15
 
16
16
 
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
 
27
- ![イメージ説明](ed1c6ef7937f74d400aae4292831e4ca.png)
27
+ ![イメージ説明](494664924ac088b6782e226ca559cafd.png)
28
28
 
29
29
 
30
30
 
@@ -120,14 +120,6 @@
120
120
 
121
121
 
122
122
 
123
- .hosting-learn-media1127 h4 {
124
-
125
-
126
-
127
- }
128
-
129
-
130
-
131
123
  .hosting-items {
132
124
 
133
125
  display: block;

1

ソースコードを追加しました。

2019/06/29 07:50

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -29,3 +29,201 @@
29
29
 
30
30
 
31
31
  この構造を画面の中央寄せする方法ってありませんか?
32
+
33
+
34
+
35
+ 以下がコードになります。
36
+
37
+ ```HTML
38
+
39
+ <div class="hosting-learn-media1127">
40
+
41
+ <div class="hosting-items">
42
+
43
+ <h4><strong>ヘッダー4</strong></h4>
44
+
45
+ <div class="flexbox-media1127-2">
46
+
47
+ <div class="hosting-item">
48
+
49
+ <div class="hosting-image1"></div>
50
+
51
+ <div class="hosting-sentence">
52
+
53
+ <p class="hosting-heading"><strong>準備1</strong></p>
54
+
55
+ <p class="hosting-paragraph">テキスト1</p>
56
+
57
+ </div>
58
+
59
+ </div>
60
+
61
+ <div class="hosting-item">
62
+
63
+ <div class="hosting-image2"></div>
64
+
65
+ <div class="hosting-sentence">
66
+
67
+ <p class="hosting-heading"><strong>準備2</strong></p>
68
+
69
+ <p class="hosting-paragraph">テキスト2</p>
70
+
71
+ </div>
72
+
73
+ </div>
74
+
75
+ <div class="hosting-item">
76
+
77
+ <div class="hosting-image3"></div>
78
+
79
+ <div class="hosting-sentence">
80
+
81
+ <p class="hosting-heading"><strong>準備3</strong></p>
82
+
83
+ <p class="hosting-paragraph">テキスト3</p>
84
+
85
+ </div>
86
+
87
+ </div>
88
+
89
+ </div>
90
+
91
+ </div>
92
+
93
+ </div>
94
+
95
+ </div>
96
+
97
+ ```
98
+
99
+
100
+
101
+ ```CSS
102
+
103
+ .flexbox-media1127-2 {
104
+
105
+ display: flex;
106
+
107
+ }
108
+
109
+
110
+
111
+ .hosting-learn-media1127 {
112
+
113
+ display: block;
114
+
115
+ width: 100%;
116
+
117
+ margin-bottom: 5rem;
118
+
119
+ }
120
+
121
+
122
+
123
+ .hosting-learn-media1127 h4 {
124
+
125
+
126
+
127
+ }
128
+
129
+
130
+
131
+ .hosting-items {
132
+
133
+ display: block;
134
+
135
+ width: 100%;
136
+
137
+ padding: 0 24px;
138
+
139
+ margin: 0 auto;
140
+
141
+ }
142
+
143
+
144
+
145
+ .hosting-item {
146
+
147
+ width: 12.75rem;
148
+
149
+ margin-right: 1rem;
150
+
151
+ }
152
+
153
+
154
+
155
+ .hosting-sentence {
156
+
157
+ border-right: solid 1px rgba(120,120,120,0.4);
158
+
159
+ border-bottom: solid 1px rgba(120,120,120,0.4);
160
+
161
+ border-left: solid 1px rgba(120,120,120,0.4);
162
+
163
+ }
164
+
165
+
166
+
167
+ .hosting-image1, .hosting-image2, .hosting-image3 {
168
+
169
+ width: 100%;
170
+
171
+ height: 6.55rem;
172
+
173
+ background-size: cover !important;
174
+
175
+ }
176
+
177
+
178
+
179
+ .hosting-heading, .hosting-paragraph {
180
+
181
+ font-size: 14px;
182
+
183
+ width: 85%;
184
+
185
+ margin-left: 1rem;
186
+
187
+ }
188
+
189
+
190
+
191
+ .hosting-heading {
192
+
193
+ padding-top: 0.5rem;
194
+
195
+ }
196
+
197
+
198
+
199
+ .hosting-paragraph {
200
+
201
+ padding-bottom: 0.5rem;
202
+
203
+ }
204
+
205
+
206
+
207
+ .hosting-image1 {
208
+
209
+ background: url('img/489faa5d-9519-48fa-aa0e-fe9673165e43.jpg') 0 0 no-repeat;
210
+
211
+ }
212
+
213
+
214
+
215
+ .hosting-image2 {
216
+
217
+ background: url('img/b77eb430-aa14-4ceb-a832-109341f798cd.jpg') 0 0 no-repeat;
218
+
219
+ }
220
+
221
+
222
+
223
+ .hosting-image3 {
224
+
225
+ background: url('img/1ad4d764-38a6-464b-8fdd-b0f3339adf2f.jpg') 0 0 no-repeat;
226
+
227
+ }
228
+
229
+ ```