This content originally appeared on Manuel Matuzović - 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;
}
}
My blog doesn't support comments yet, but you can reply via blog@matuzo.at.
This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović

Manuel Matuzović | Sciencx (2022-12-13T00:00:00+00:00) Day 57: media queries: range syntax. Retrieved from https://www.scien.cx/2022/12/13/day-57-media-queries-range-syntax-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.