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

質問編集履歴

2

記載箇所の訂正

2021/03/03 08:38

投稿

mikan23
mikan23

スコア13

title CHANGED
File without changes
body CHANGED
@@ -1,56 +1,52 @@
1
+ ```<HTML>
2
+ <div class="grid">
3
+ <div class="grid1">
4
+ <p><h3> タイトル</h3>
5
+ <h4>本文
6
+ </h4></p>
7
+ </div>
8
+ <div class="grid2">
9
+ <img src="images/about_dogs.jpg" class="dogpic" alt="dog">
10
+ </div>
11
+ <div class="grid3">
12
+ <img src="images/takeout_pic.jpg" class="togopic" alt="togo">
13
+ </div>
14
+ <div class="grid4">
15
+ <p><h3>タイトル</h3>
16
+ <h4>本文</h4>
17
+ </p>
18
+ </div>
19
+ </div>
20
+ <CSS>
21
+ .grid {
22
+ display: grid;
23
+ grid-template-columns: repeat(2, 1fr);
24
+ grid-template-rows: 500px 500px;
25
+ }
26
+ .grid1 {
27
+ background-color: #a2ded0;
28
+ }
29
+ .grid1 p {
30
+ display: inline-block;
31
+ }
32
+ .grid2 {
33
+ background-color: #f4d03f;
34
+ }
35
+ .grid3 {
36
+ background-color: #6c7a89;
37
+ }
38
+ .grid4 {
39
+ background-color: #59abe3;
40
+ }
41
+ .grid img{
42
+ width: 100%;
43
+ height:100%;
44
+ object-fit: contain;
45
+ }
46
+ ```
1
47
  各500px×500pxの4マスのgrid layoutを作成しています。
2
48
  こちらのサイトの写真部分ようにページ幅に合わせて500×500がそのまま拡大縮小していく設定にしたいのですがうまくできません。
3
49
 
4
-
5
50
  あと画像がマスいっぱいに広がりません。
6
51
  どうしたら良いでしょうか?
7
- よろしくお願いします。`
52
+ よろしくお願いします。`
8
-
9
- <HTML>
10
-
11
- <div class="grid">
12
- <div class="grid1">
13
- <p><h3> タイトル</h3>
14
- <h4>本文
15
- </h4></p>
16
- </div>
17
- <div class="grid2">
18
- <img src="images/about_dogs.jpg" class="dogpic" alt="dog">
19
- </div>
20
- <div class="grid3">
21
- <img src="images/takeout_pic.jpg" class="togopic" alt="togo">
22
- </div>
23
- <div class="grid4">
24
- <p><h3>タイトル</h3>
25
- <h4>本文</h4>
26
- </p>
27
- </div>
28
- </div>
29
-
30
- <CSS>
31
-
32
- .grid {
33
- display: grid;
34
- grid-template-columns: repeat(2, 1fr);
35
- grid-template-rows: 500px 500px;
36
- }
37
- .grid1 {
38
- background-color: #a2ded0;
39
- }
40
- .grid1 p {
41
- display: inline-block;
42
- }
43
- .grid2 {
44
- background-color: #f4d03f;
45
- }
46
- .grid3 {
47
- background-color: #6c7a89;
48
- }
49
- .grid4 {
50
- background-color: #59abe3;
51
- }
52
- .grid img{
53
- width: 100%;
54
- height:100%;
55
- object-fit: contain;
56
- }

1

タイトルの誤字

2021/03/03 08:38

投稿

mikan23
mikan23

スコア13

title CHANGED
@@ -1,1 +1,1 @@
1
- ul liのメニューバー
1
+ グリッドレイアウトについて
body CHANGED
@@ -1,7 +1,7 @@
1
1
  各500px×500pxの4マスのgrid layoutを作成しています。
2
2
  こちらのサイトの写真部分ようにページ幅に合わせて500×500がそのまま拡大縮小していく設定にしたいのですがうまくできません。
3
- https://www.fetchingfields.com/
4
3
 
4
+
5
5
  あと画像がマスいっぱいに広がりません。
6
6
  どうしたら良いでしょうか?
7
7
  よろしくお願いします。`