-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsiveGridcontainer.html
52 lines (52 loc) · 1.22 KB
/
responsiveGridcontainer.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Responsive Container</title>
<style>
.container {
display: grid;
width: 100%;
grid-template-columns: 30% 30%;
grid-template-rows: 80px 40px 40px 40px;
grid-template-rows: auto auto;
background-color: lightblue;
padding: 15px;
column-gap: 2px;
justify-content: center;
}
.container > div {
background-color: lightgreen;
padding: 5px;
border: 1px solid black;
}
@media only screen and (max-width: 500px) {
.container {
grid-template-columns: 10% 10% 10% 10%;
justify-content: left;
}
}
</style>
</head>
<body>
<div class="container">
<div>one</div>
<div>two</div>
<div>three</div>
<div>four</div>
<div>one</div>
<div>two</div>
<div>three</div>
<div>four</div>
<div>one</div>
<div>two</div>
<div>three</div>
<div>four</div>
<div>one</div>
<div>two</div>
<div>three</div>
<div>four</div>
</div>
</body>
</html>