How to write a media request to have all devices in landscape orientation, but with a size smaller than the specified? That is, in the code something like this should be -

@media all and (orientation: landscape) and (not min-width: 300px) and (not min-height: 500px){} 

That is, I need to perform an action with the code only when landscape orientation, but on condition that the viewport size is less than 300x500.

  • one
    not min-width: 500px = max-width: 500px - MasterAlex
  • @MasterAlex don't quite understand what you're talking about ... I ask you to help me compose a media query that works when landscape orientation is on a screen smaller than 500x500. With this 1000x300 should pass. - Ivan Petrov
  • @MasterAlex, Wrong. The value 500 does not fall into the first, but falls into the second. - Qwertiy

1 answer 1

Landscape orientation with a height of more than 500 and a width of less than 500 is in doubt.

Probably it should

 @media all and (max-height: 500px) 
  • I took the size from my head, that is, I invented it. - Ivan Petrov
  • @IvanPetrov, you need to ask the question more precisely. And try adding brackets, I'm not sure if they are needed there or not. - Qwertiy
  • corrected the question and added the FORGOTTEN second not - Ivan Petrov
  • @IvanPetrov 1. Try adding brackets here: (not min-width: 300px) => (not (min-width: 300px)) . 2. Why not use not min-* instead of not min-* max-* ? 3. In the landscape , because the height can not be greater than the width? - Qwertiy