This content originally appeared on Manuel Matuzović - Web development blog and was authored by Manuel Matuzović
With CSS Media Queries Level 4, it's possible to use mathematical comparison operators in media queries.
Instead of (min-width: 768px)
you can now write (width >= 768px)
.
Before
@media(min-width: 768px) {
body {
background-color: aqua;
}
}
After
@media(width >= 768px) {
body {
background-color: aqua;
}
}
Before
@media(min-width: 400px) and (max-width: 800px) {
body {
border: 40px dotted yellow;
}
}
After
@media(400px <= width <= 800px) {
body {
border: 40px dotted yellow;
}
}
This content originally appeared on Manuel Matuzović - Web development blog and was authored by Manuel Matuzović
Manuel Matuzović | Sciencx (2022-12-13T09:38:54+00:00) Day 57: media queries: range syntax. Retrieved from https://www.scien.cx/2022/12/13/day-57-media-queries-range-syntax/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.