Categories
CSS

How to use CSS media queries to select max-width OR max-height?

Spread the love

To use CSS media queries to select max-width OR max-height, we separate the queries by commas.

For instance, we write

@media screen and (max-width: 995px), screen and (max-height: 700px) {
  //...
}

to select screen sizes with max width 995px or max height 700px.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *