-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path45CSSGridMediaQuery.html
More file actions
107 lines (94 loc) · 2.53 KB
/
45CSSGridMediaQuery.html
File metadata and controls
107 lines (94 loc) · 2.53 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Grid Media Query</title>
<style>
.container {
display: grid;
grid-gap: 1rem;
grid-template-areas:
'navbar navbar navbar navbar'
'section section section aside'
'footer footer footer footer';
}
@media (max-width:300px) {
body {
background-color: red;
}
}
@media (min-width:300px) and (max-width:500px) {
body {
background-color: yellow;
}
.container {
grid-template-areas:
'navbar navbar navbar navbar'
'section section section section'
'footer footer footer footer';
}
aside{
display: none;
}
}
@media (min-width:500px) and (max-width:800px) {
body {
background-color: green;
}
.container {
grid-template-areas:
'navbar navbar navbar navbar'
'section section section section'
'aside aside aside aside'
'footer footer footer footer';
}
span{
display: block;
text-align: center;
}
}
@media (min-width:800px) {
body {
background-color: brown;
}
}
.bdr {
border: 2px solid black;
padding: 20px;
background-color: aqua;
}
nav {
grid-area: navbar;
}
section {
grid-area: section;
}
aside {
grid-area: aside;
}
footer {
grid-area: footer;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<nav class="bdr">
<span>Home</span>
<span>Services</span>
<span>Contact</span>
<span>About Us</span>
</nav>
<section class="bdr">
<h2>Learn Web Development</h2>
</section>
<aside class="bdr">
<h1>Learn new things</h1>
</aside>
</div>
<footer class="bdr">Copyright Chintan Patel 2022</footer>
</body>
</html>