0

This is my media query for resolution with width of 1280 pixels:

@media (min-width: 1270px) and (max-width: 1280px)

When I want to use seperate query for height like this:

@media (min-width: 1270px) and (max-height: 960px)

It doesn't work. It's not showing even in the developer tools in chrome. Can I get some suggestions?

jeerbl
  • 7,537
  • 5
  • 25
  • 39
frenchbaguette
  • 1,297
  • 6
  • 22
  • 41

2 Answers2

0

you need to add a comma between different conditions (width/height)

@media screen and (min-width: 1270px), screen and (max-height: 960px )

https://jsfiddle.net/ahmadabdul3/fxaknLn7/

Abdul Ahmad
  • 9,673
  • 16
  • 64
  • 127
  • It would be good now, but now it's shows that at first uses `@media (max-width: 1280px) and (min-width: 1270px)` and just then the one with `height` – frenchbaguette Feb 11 '16 at 21:42
  • there's another problem then. are you referencing multiple css files? do they have different media queries? check all these things. did you try clearing your browser's cache? refresh page after. etc – Abdul Ahmad Feb 11 '16 at 21:44
  • I'm using only one .css It just shows this: `@media (min-width: 1270px) and (max-width: 1280px )` and then `@media (min-width: 1270px) and (max-height: 960px )` this – frenchbaguette Feb 11 '16 at 21:45
  • did you clear your browser cache? go to settings -> history -> clear all browsing data – Abdul Ahmad Feb 11 '16 at 21:47
  • Yes. I think I have a problem with res. There were before the same things happened and I manage to fixed them, probably I should try another options – frenchbaguette Feb 11 '16 at 21:49
-1

You must add this code at first

<meta name="viewport" content="width=device-width" />

and use this link

https://css-tricks.com/logic-in-media-queries/

@media screen and (max-width: 995px) , screen and (max-height: 700px) {
  ...
}
nyn05
  • 540
  • 5
  • 17