-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (94 loc) · 3.1 KB
/
index.html
File metadata and controls
112 lines (94 loc) · 3.1 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
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Breakpoints Demo</title>
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
font-family: 'Montserrat', sans-serif;
/* margin: 0;
padding: 0; */
}
.container {
margin-top: 100px;
margin-bottom: 50px;
border: 2px solid transparent;
padding: 50px;
background-color: #e6ecf0;
font-size: 24px;
text-align: center;
color: white;
font-weight: 700;
}
.screen-size {
font-size: 18px;
position: fixed;
top: 10px;
left: 10px;
background-color: #4a4a4f;
color: #fff;
padding: 10px;
}
@media (max-width: 575.98px) {
.container {
background-color: #e84610;
}
}
@media (min-width: 576px) and (max-width: 767.98px) {
.container {
background-color: #009fe3;
}
}
@media (min-width: 768px) and (max-width: 991.98px) {
.container {
background-color: #23bbbb;
}
}
@media (min-width: 992px) and (max-width: 1199.98px) {
.container {
background-color: #445261;
}
}
@media (min-width: 1200px) {
.container {
background-color: #ff5a60;
}
@media (min-width: 1400px) {
.container {
background-color: #efb920;
}
}
</style>
</head>
<body>
<div class="container border"><span id="screen-size-info"></span></div>
<!-- Bootstrap JS Bundle -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
<script>
function updateScreenSize() {
const screenSizeInfo = document.getElementById('screen-size-info');
const screenWidth = window.innerWidth;
let screenSize = '';
if (screenWidth < 576) {
screenSize = 'Extra Small <br> < 576px';
} else if (screenWidth >= 576 && screenWidth < 768) {
screenSize = 'Small <br> >= 576px';
} else if (screenWidth >= 768 && screenWidth < 992) {
screenSize = 'Medium <br> >= 768px';
} else if (screenWidth >= 992 && screenWidth < 1200) {
screenSize = 'Large <br> >= 992px';
} else if (screenWidth >= 1200 && screenWidth < 1400) {
screenSize = 'Extra Large <br> >= 1200px';
} else {
screenSize = 'XXL <br> >= 1400px';
}
screenSizeInfo.innerHTML = screenSize;
}
window.addEventListener('resize', updateScreenSize);
updateScreenSize();
</script>
</body>
</html>