PreFiXAUT
PreFiXAUT

Reputation: 140

CSS Media Query applies out of range

I'm using following media query:

@media (max-width: 1439px) and (min-width: 940px) {
    ...
}

The strange part about it is, that when I try it on my phone or with the chrome device emulation, it always applies. No matter how small the browser/emulation window is.

Upvotes: 0

Views: 741

Answers (1)

Alexis
Alexis

Reputation: 5831

When you use media queries you must specify the type of media (screen)

@media screen and (max-width: 1439px) and (min-width: 940px) {...}

Second thing, you must include in your html this <meta>

<meta name="viewport" content="width=device-width, initial-scale=1" />

Upvotes: 3

Related Questions