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

回答編集履歴

3

typo

2026/02/20 06:59

投稿

yambejp
yambejp

スコア118347

answer CHANGED
@@ -39,7 +39,7 @@
39
39
  .wrap{
40
40
  justify-content: center;
41
41
  display:grid;
42
- padding:20pxl
42
+ padding:20px;
43
43
  gap:20px;
44
44
  border:solid 1px blue;
45
45
  grid-template-columns:repeat(auto-fit, minmax(200px,0px));

2

chousei

2026/02/20 06:57

投稿

yambejp
yambejp

スコア118347

answer CHANGED
@@ -39,8 +39,8 @@
39
39
  .wrap{
40
40
  justify-content: center;
41
41
  display:grid;
42
+ padding:20pxl
42
43
  gap:20px;
43
- place-items: center;
44
44
  border:solid 1px blue;
45
45
  grid-template-columns:repeat(auto-fit, minmax(200px,0px));
46
46
  }

1

調整

2026/02/20 06:54

投稿

yambejp
yambejp

スコア118347

answer CHANGED
@@ -30,4 +30,36 @@
30
30
  <div>10</div>
31
31
  <div>11</div>
32
32
  </div>
33
+ ```
34
+
35
+ # 調整
36
+ 画像幅固定でブラウザの幅で列数を可変に
37
+ ```html
38
+ <style>
39
+ .wrap{
40
+ justify-content: center;
41
+ display:grid;
42
+ gap:20px;
43
+ place-items: center;
44
+ border:solid 1px blue;
45
+ grid-template-columns:repeat(auto-fit, minmax(200px,0px));
46
+ }
47
+ .wrap div{
48
+ width:200px;
49
+ border:solid 1px red;
50
+ }
51
+ </style>
52
+ <div class="wrap">
53
+ <div>1</div>
54
+ <div>2</div>
55
+ <div>3</div>
56
+ <div>4</div>
57
+ <div>5</div>
58
+ <div>6</div>
59
+ <div>7</div>
60
+ <div>8</div>
61
+ <div>9</div>
62
+ <div>10</div>
63
+ <div>11</div>
64
+ </div>
33
65
  ```