-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15-Responsive Design & Media Queries.html
More file actions
69 lines (59 loc) · 1.23 KB
/
15-Responsive Design & Media Queries.html
File metadata and controls
69 lines (59 loc) · 1.23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>15 - Responsive Design & Media Queries</title>
<style>
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
h1 {
margin-bottom: 20px;
}
/* Container */
.container {
display: flex;
gap: 20px;
}
/* Box */
.box {
background: lightblue;
padding: 40px;
flex: 1;
text-align: center;
font-size: 24px;
}
/* Mobile / Tablet */
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.box {
background: yellowgreen;
font-size: 18px;
}
}
/* Desktop */
@media (min-width: 768px) {
.container {
flex-direction: row;
}
.box {
background: red;
}
}
</style>
</head>
<body>
<h1>Responsive Design Demo</h1>
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
</div>
</body>
</html>