Avatar of Bruce Gust
Bruce Gust
Flag for United States of America

asked on 

What's the difference between "Portrait and Landscape" and "Portrait" or "Landscape?"

Here's a guide that I got from https://css-tricks.com/snippets/css/media-queries-for-standard-devices/. Part of his resource has this:

/* ----------- iPhone 5 and 5S ----------- */

/* Portrait and Landscape */
@media only screen
  and (min-device-width: 320px)
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2) {

}

/* Portrait */
@media only screen
  and (min-device-width: 320px)
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {
}

/* Landscape */
@media only screen
  and (min-device-width: 320px)
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) {

}

What's the difference between having a setting that's being prescribed for "Portrait and Landscape" as well as "Portrait" and "Landscape?" It seems like that "Portrait and Landscape" setting expects the user to be able to see the screen in two different resolutions at the same time, and I know that can't be right.

Can someone explain this to me?
CSS

Avatar of undefined
Last Comment
Bruce Gust

8/22/2022 - Mon