-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS-grid-area.html
67 lines (64 loc) · 1.28 KB
/
CSS-grid-area.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Area</title>
<style>
.wrapper>div{
display: flex;
justify-content: center;
align-items: center;
}
.wrapper {
display: grid;
grid-gap: 2px;
grid-template-columns: repeat(4,1fr);
grid-template-rows: 150px 150px 150px 150px;
grid-template-areas:
"a a b b"
"a a b b"
"d d c c"
"d d c c"
;
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3{
grid-area: c;
}
.item4{
grid-area:d;
}
/* .wrapper>div:nth-child(1){
background: darkgoldenrod;
}
.wrapper>div:nth-child(2){
background: rgb(11, 184, 40);
}
.wrapper>div:nth-child(3){
background: sandybrown;
}
.wrapper>div:nth-child(4){
background: crimson;
} */
div>img{
width: 100%;
height: 100%;
object-fit: fill;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="item1"><img src="img/html.jpg" alt=""></div>
<div class="item2"><img src="img/css.jpg" alt=""></div>
<div class="item3"><img src="img/JS.jpg" alt=""></div>
<div class="item4"><img src="img/vscode.png" alt=""></div>
</div>
</body>
</html>