回答編集履歴

4

サンプルリンク追加

2020/03/11 10:27

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -230,6 +230,8 @@
230
230
 
231
231
  ```
232
232
 
233
+ [Codepenサンプル](https://codepen.io/hatena19/pen/jOPZyyx)
234
+
233
235
 
234
236
 
235
237
  時間がないので余白とか、冗長な部分はそのままなので、これをたたき台にしてみてください。

3

コード修正

2020/03/11 10:27

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -12,38 +12,224 @@
12
12
 
13
13
  ```html
14
14
 
15
+ <main>
16
+
17
+
18
+
19
+ <div class="box"></div>
20
+
21
+ <div class="content">たひてぞぽぞばれぐてひろどにらぼもぎゎぃそんつぢゅぴぢにどくぁぶはぇきぼねおひろ</div>
22
+
23
+ <div class="box-bottom">
24
+
25
+ <p>八木 歓菜</p>
26
+
27
+ <p class="gray">部署 4</p>
28
+
29
+ </div>
30
+
31
+ <div class="icon-bottom">
32
+
33
+ <img src="http://placehold.jp/80x80.png">
34
+
35
+ </div>
36
+
37
+
38
+
39
+ <div class="box2"></div>
40
+
41
+ <div class="content2">ぷゎょゎぼむべぁうくれげゑうぃちぽびぽじふすらざまぴせぴろとぜげゎぜこをあこでべ</div>
42
+
43
+ <div class="box-bottom2">
44
+
45
+ <p>安達 和樹</p>
46
+
47
+ <p class="gray">部署 4</p>
48
+
49
+ </div>
50
+
51
+ <div class="icon-bottom2">
52
+
53
+ <img src="http://placehold.jp/80x80.png">
54
+
55
+ </div>
56
+
57
+
58
+
59
+ <div class="box3"></div>
60
+
61
+ <div class="content3">ぅひみぺつぇげでいぎみがちぢかひげずふをけぬそへられべゑやまぇげかぷい</div>
62
+
63
+ <div class="box-bottom3">
64
+
65
+ <p>泉 恵華</p>
66
+
67
+ <p class="gray">部署 2</p>
68
+
69
+ </div>
70
+
71
+ <div class="icon-bottom3">
72
+
73
+ <img src="http://placehold.jp/80x80.png">
74
+
75
+ </div>
76
+
77
+
78
+
79
+ </main>
80
+
81
+ ```
82
+
83
+
84
+
85
+ ```css
86
+
15
87
  main {
16
88
 
17
89
  display: grid;
18
90
 
19
- grid-template-columns: 1auto 1max-content 1max-content;
91
+ grid-template-columns: 1fr max-content max-content;
92
+
93
+ grid-template-rows: auto auto auto auto auto auto;
20
94
 
21
95
  grid-gap: 5px;
22
96
 
23
97
  }
24
98
 
99
+
100
+
101
+ .content {
102
+
103
+ padding: 15px 25px 15px 15px;
104
+
105
+ grid-column: 1 / 4;
106
+
107
+ grid-row: 1 / 2;
108
+
109
+ }
110
+
111
+
112
+
113
+ .box-bottom {
114
+
115
+ grid-column: 2 / 3;
116
+
117
+ grid-row: 2 / 3;
118
+
119
+ }
120
+
121
+ .icon-bottom {
122
+
123
+ grid-column: 3 / 4;
124
+
125
+ grid-row: 2 / 3;
126
+
127
+ }
128
+
129
+
130
+
131
+ .box {
132
+
133
+ grid-column: 1 / 4;
134
+
135
+ grid-row: 1 / 3;
136
+
137
+ box-shadow: 0 5px 10px rgba(0,0,0,0.3);
138
+
139
+ border-radius: 10px;
140
+
141
+ }
142
+
143
+
144
+
145
+ .content2 {
146
+
147
+ padding: 15px 25px 15px 15px;
148
+
149
+ grid-column: 1 / 4;
150
+
151
+ grid-row: 3 / 4;
152
+
153
+ }
154
+
155
+
156
+
157
+ .box-bottom2 {
158
+
159
+ grid-column: 2 / 3;
160
+
161
+ grid-row: 4 / 5;
162
+
163
+ }
164
+
165
+ .icon-bottom2 {
166
+
167
+ grid-column: 3 / 4;
168
+
169
+ grid-row: 4 / 5;
170
+
171
+ }
172
+
173
+
174
+
175
+ .box2 {
176
+
177
+ grid-column: 1 / 4;
178
+
179
+ grid-row: 3 / 5;
180
+
181
+ box-shadow: 0 5px 10px rgba(0,0,0,0.3);
182
+
183
+ border-radius: 10px;
184
+
185
+ }
186
+
187
+
188
+
189
+ .content3 {
190
+
191
+ padding: 15px 25px 15px 15px;
192
+
193
+ grid-column: 1 / 4;
194
+
195
+ grid-row: 5 / 6;
196
+
197
+ }
198
+
199
+
200
+
201
+ .box-bottom3 {
202
+
203
+ grid-column: 2 / 3;
204
+
205
+ grid-row: 6 / 7;
206
+
207
+ }
208
+
209
+ .icon-bottom3 {
210
+
211
+ grid-column: 3 / 4;
212
+
213
+ grid-row: 6 / 7;
214
+
215
+ }
216
+
217
+
218
+
219
+ .box3 {
220
+
221
+ grid-column: 1 / 4;
222
+
223
+ grid-row: 5 / 7;
224
+
225
+ box-shadow: 0 5px 10px rgba(0,0,0,0.3);
226
+
227
+ border-radius: 10px;
228
+
229
+ }
230
+
25
231
  ```
26
232
 
27
233
 
28
234
 
29
- ```css
30
-
31
- .content {
32
-
33
- grid-column: 1 / 4;
235
+ 時間がないので余白とか、冗長な部分はそのままなので、これをたたき台にしてみてください。
34
-
35
- }
36
-
37
- .box-bottom {
38
-
39
- grid-column: 2 / 3;
40
-
41
- }
42
-
43
- .icon-bottom {
44
-
45
- grid-column: 3 / 4;
46
-
47
- }
48
-
49
- ```

2

修正

2020/03/11 08:26

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -1,46 +1,26 @@
1
+ Flexboxでは無理っぽい。
2
+
3
+
4
+
5
+ CSS Grid の出番かな。
6
+
7
+
8
+
1
- ~~とりあえずエスパー回答すると~~ しまった!投稿したらHTMLが追されていた
9
+ とりあえず、のような感じ
10
+
11
+
2
12
 
3
13
  ```html
4
14
 
5
- <div class="wrapper">
15
+ main {
6
16
 
7
- <div class="inner">
17
+ display: grid;
8
18
 
9
- aaaaaa
19
+ grid-template-columns: 1auto 1max-content 1max-content;
10
20
 
11
- </div>
21
+ grid-gap: 5px;
12
22
 
13
- </div>
14
-
15
- <div class="wrapper">
16
-
17
- <div class="inner">
18
-
19
- aaaaaaaaaaaaaaa
23
+ }
20
-
21
- </div>
22
-
23
- </div>
24
-
25
- <div class="wrapper">
26
-
27
- <div class="inner">
28
-
29
- aaaaaaaaaaaaaaaaaaaaaaaa
30
-
31
- </div>
32
-
33
- </div>
34
-
35
- <div class="wrapper">
36
-
37
- <div class="inner">
38
-
39
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
40
-
41
- </div>
42
-
43
- </div>
44
24
 
45
25
  ```
46
26
 
@@ -48,34 +28,22 @@
48
28
 
49
29
  ```css
50
30
 
51
- .wrapper {
31
+ .content {
52
32
 
53
- display: flex;
54
-
55
- justify-content: flex-end;
33
+ grid-column: 1 / 4;
56
-
57
- max-width: 500px;
58
-
59
- border: 1px solid gray;
60
-
61
- margin-bottom: 10px;
62
34
 
63
35
  }
64
36
 
37
+ .box-bottom {
65
38
 
39
+ grid-column: 2 / 3;
66
40
 
67
- .inner {
41
+ }
68
42
 
69
- display: inline-block;
43
+ .icon-bottom {
70
44
 
71
- border-left: 1px solid gray;
45
+ grid-column: 3 / 4;
72
-
73
- padding: 5px;
74
46
 
75
47
  }
76
48
 
77
49
  ```
78
-
79
-
80
-
81
- ![イメージ説明](5abc548b45285d37add4381447cc7b09.png)

1

修正

2020/03/11 07:49

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -1,6 +1,4 @@
1
- とりあえずエスパー回答すると、
1
+ ~~とりあえずエスパー回答すると、~~ しまった!投稿したらHTMLが追記されていた。
2
-
3
-
4
2
 
5
3
  ```html
6
4