I wanna to get an if-Statement in CSS. If the viewport is under 1000px, then css should do sth. and then also an else-Statement. Is it possible only with css, or does I also need Java or sth. else
Asked
Active
Viewed 75 times
0
-
You're looking for [CSS media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries). – domsson May 16 '20 at 11:33
1 Answers
0
You can use media queries to do so:
@media all and (max-width: 999px) {
/* Place your styles here */
}
@media all and (min-width: 1000px) {
/* Place your other styles here */
}

Láďa Durchánek
- 1,199
- 8
- 16