回答編集履歴

2

修正

2019/10/19 13:58

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  > ```
24
24
 
25
- > > 引用元: [https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23](https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23)
25
+ > 引用元: [https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23](https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23)
26
26
 
27
27
 
28
28
 
@@ -188,7 +188,7 @@
188
188
 
189
189
 
190
190
 
191
- そして、各行内における要素間の間隔を隣接セレクタを用いて記述ます。
191
+ そして、各行内における要素間の間隔を隣接セレクタを用いて記述すると、改行が行われることなく各列間での間隔をあけることが出来ます ([動作確認用リンク](https://jsfiddle.net/rd04h25k/))
192
192
 
193
193
 
194
194
 
@@ -239,7 +239,3 @@
239
239
  }
240
240
 
241
241
  ```
242
-
243
-
244
-
245
- すると、改行が行われることなく各列間での間隔をあけることが出来ます ([動作確認用リンク](https://jsfiddle.net/rd04h25k/))。

1

修正

2019/10/19 13:58

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -8,238 +8,238 @@
8
8
 
9
9
  > ```SCSS
10
10
 
11
- @mixin make-row($gutter: $grid-gutter-width) {
12
-
13
- display: flex;
14
-
15
- flex-wrap: wrap;
16
-
17
- margin-right: -$gutter / 2;
18
-
19
- margin-left: -$gutter / 2;
20
-
21
- }
11
+ > @mixin make-row($gutter: $grid-gutter-width) {
12
+
13
+ > display: flex;
14
+
15
+ > flex-wrap: wrap;
16
+
17
+ > margin-right: -$gutter / 2;
18
+
19
+ > margin-left: -$gutter / 2;
20
+
21
+ > }
22
+
23
+ > ```
24
+
25
+ > > 引用元: [https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23](https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23)
26
+
27
+
28
+
29
+
30
+
31
+ これを解決する方法には、 `flex-wrap` プロパティに `nowrap` を指定する方法があります。Bootstrap 4 では `.flex-nowrap` クラスを用いて同様のことが行える ([参考](https://getbootstrap.com/docs/4.0/utilities/flex/#wrap)) ため、これを各行へ追加します。
32
+
33
+
34
+
35
+ ```HTML
36
+
37
+ <div class="container-fluid " id="service">
38
+
39
+ <div class="row justify-content-center">
40
+
41
+ <div class="col-md-12">
42
+
43
+ <div class="text-center">
44
+
45
+ <h2>Services</h2>
46
+
47
+ <p>whta I can</p>
48
+
49
+ </div>
50
+
51
+ </div>
52
+
53
+ </div>
54
+
55
+ <div class="container">
56
+
57
+ <div class="row mt-5 text-center flex-nowrap"> <!-- 追加 -->
58
+
59
+ <div class="col-md-4 service">
60
+
61
+ <div class="icon">
62
+
63
+ <i class="far fa-edit"></i>
64
+
65
+ </div>
66
+
67
+ <div class="">
68
+
69
+ <h5>ランディングページ(LP)作成</h5>
70
+
71
+ <p></p>
72
+
73
+ </div>
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div class="col-md-4 service">
80
+
81
+ <div class="icon">
82
+
83
+ <i class="fas fa-desktop"></i>
84
+
85
+ </div>
86
+
87
+ <div class="">
88
+
89
+ <h5>ブログ型ホームページの作成</h5>
90
+
91
+ </div>
92
+
93
+
94
+
95
+ </div>
96
+
97
+ <div class="col-md-4 service">
98
+
99
+ <div class="icon">
100
+
101
+ <i class="fas fa-paint-brush"></i>
102
+
103
+ </div>
104
+
105
+ <div class="">
106
+
107
+ <h5>記事執筆</h5>
108
+
109
+ </div>
110
+
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ </div>
118
+
119
+ <div class="row text-center flex-nowrap"> <!-- 追加 -->
120
+
121
+ <div class="col-md-4 service ">
122
+
123
+ <div class="icon">
124
+
125
+ <i class="fas fa-camera"></i>
126
+
127
+ </div>
128
+
129
+ <div class="">
130
+
131
+ <h5>動画編集</h5>
132
+
133
+ <p></p>
134
+
135
+ </div>
136
+
137
+
138
+
139
+ </div>
140
+
141
+ <div class="col-md-4 service">
142
+
143
+ <div class="icon">
144
+
145
+ <i class="fas fa-user-alt"></i>
146
+
147
+ </div>
148
+
149
+ <div class="">
150
+
151
+ <h5>サポート</h5>
152
+
153
+ <p></p>
154
+
155
+ </div>
156
+
157
+
158
+
159
+ </div>
160
+
161
+ <div class="col-md-4 service">
162
+
163
+ <div class="icon">
164
+
165
+ <i class="fas fa-print"></i>
166
+
167
+ </div>
168
+
169
+ <div class="">
170
+
171
+ <h5>SEO 対策</h5>
172
+
173
+ </div>
174
+
175
+
176
+
177
+ </div>
178
+
179
+ </div>
180
+
181
+ </div>
182
+
183
+
184
+
185
+ </div>
22
186
 
23
187
  ```
24
188
 
25
- > 引用元: [https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23](https://github.com/twbs/bootstrap/blob/104385c508a4c77761b04a9842e978bab6f359f6/scss/mixins/_grid.scss#L23)
26
-
27
-
28
-
29
-
30
-
31
- これを解決する方法には、 `flex-wrap` プロパティに `nowrap` を指定する方法があります。Bootstrap 4 では `.flex-nowrap` クラスを用いて同様のことが行える ([参考](https://getbootstrap.com/docs/4.0/utilities/flex/#wrap)) ため、これを各行へ追加します。
32
-
33
-
34
-
35
- ```HTML
36
-
37
- <div class="container-fluid " id="service">
38
-
39
- <div class="row justify-content-center">
40
-
41
- <div class="col-md-12">
42
-
43
- <div class="text-center">
44
-
45
- <h2>Services</h2>
46
-
47
- <p>whta I can</p>
48
-
49
- </div>
50
-
51
- </div>
52
-
53
- </div>
54
-
55
- <div class="container">
56
-
57
- <div class="row mt-5 text-center flex-nowrap"> <!-- 追加 -->
58
-
59
- <div class="col-md-4 service">
60
-
61
- <div class="icon">
62
-
63
- <i class="far fa-edit"></i>
64
-
65
- </div>
66
-
67
- <div class="">
68
-
69
- <h5>ランディングページ(LP)作成</h5>
70
-
71
- <p></p>
72
-
73
- </div>
74
-
75
-
76
-
77
- </div>
78
-
79
- <div class="col-md-4 service">
80
-
81
- <div class="icon">
82
-
83
- <i class="fas fa-desktop"></i>
84
-
85
- </div>
86
-
87
- <div class="">
88
-
89
- <h5>ブログ型ホームページの作成</h5>
90
-
91
- </div>
92
-
93
-
94
-
95
- </div>
96
-
97
- <div class="col-md-4 service">
98
-
99
- <div class="icon">
100
-
101
- <i class="fas fa-paint-brush"></i>
102
-
103
- </div>
104
-
105
- <div class="">
106
-
107
- <h5>記事執筆</h5>
108
-
109
- </div>
110
-
111
-
112
-
113
- </div>
114
-
115
-
116
-
117
- </div>
118
-
119
- <div class="row text-center flex-nowrap"> <!-- 追加 -->
120
-
121
- <div class="col-md-4 service ">
122
-
123
- <div class="icon">
124
-
125
- <i class="fas fa-camera"></i>
126
-
127
- </div>
128
-
129
- <div class="">
130
-
131
- <h5>動画編集</h5>
132
-
133
- <p></p>
134
-
135
- </div>
136
-
137
-
138
-
139
- </div>
140
-
141
- <div class="col-md-4 service">
142
-
143
- <div class="icon">
144
-
145
- <i class="fas fa-user-alt"></i>
146
-
147
- </div>
148
-
149
- <div class="">
150
-
151
- <h5>サポート</h5>
152
-
153
- <p></p>
154
-
155
- </div>
156
-
157
-
158
-
159
- </div>
160
-
161
- <div class="col-md-4 service">
162
-
163
- <div class="icon">
164
-
165
- <i class="fas fa-print"></i>
166
-
167
- </div>
168
-
169
- <div class="">
170
-
171
- <h5>SEO 対策</h5>
172
-
173
- </div>
174
-
175
-
176
-
177
- </div>
178
-
179
- </div>
180
-
181
- </div>
182
-
183
-
184
-
185
- </div>
189
+
190
+
191
+ そして、各行内における要素間の間隔を隣接セレクタを用いて記述します。
192
+
193
+
194
+
195
+ ```CSS
196
+
197
+ .container-fluid {
198
+
199
+ width: 100%;
200
+
201
+ box-sizing: border-box;
202
+
203
+ }
204
+
205
+
206
+
207
+ .row {
208
+
209
+ width: 100%;
210
+
211
+ box-sizing: border-box;
212
+
213
+ }
214
+
215
+
216
+
217
+ .service {
218
+
219
+ border: 1px solid silver;
220
+
221
+ margin-bottom: 30px;
222
+
223
+ position: relative;
224
+
225
+ width: 100%;
226
+
227
+ padding-right: 15px;
228
+
229
+ padding-left: 15px;
230
+
231
+ }
232
+
233
+
234
+
235
+ .col-md-4 + .col-md-4 { /* 追加 */
236
+
237
+ margin-left: .5em;
238
+
239
+ }
186
240
 
187
241
  ```
188
242
 
189
243
 
190
244
 
191
- そして、各行内における要素間の間隔を隣接セレクタを用いて記述します。
192
-
193
-
194
-
195
- ```CSS
196
-
197
- .container-fluid {
198
-
199
- width: 100%;
200
-
201
- box-sizing: border-box;
202
-
203
- }
204
-
205
-
206
-
207
- .row {
208
-
209
- width: 100%;
210
-
211
- box-sizing: border-box;
212
-
213
- }
214
-
215
-
216
-
217
- .service {
218
-
219
- border: 1px solid silver;
220
-
221
- margin-bottom: 30px;
222
-
223
- position: relative;
224
-
225
- width: 100%;
226
-
227
- padding-right: 15px;
228
-
229
- padding-left: 15px;
230
-
231
- }
232
-
233
-
234
-
235
- .col-md-4 + .col-md-4 { /* 追加 */
236
-
237
- margin-left: .5em;
238
-
239
- }
240
-
241
- ```
242
-
243
-
244
-
245
245
  すると、改行が行われることなく各列間での間隔をあけることが出来ます ([動作確認用リンク](https://jsfiddle.net/rd04h25k/))。