K
K
krs-front2016-02-19 03:43:20
css
krs-front, 2016-02-19 03:43:20

Why don't media queries work on localhost (chrome)?

@media (min-width: 992px) {
    .navigation {
        &_item {
            background: red;
        }
    }
}

@media (min-width: 1200px) {
    .navigation {
        &_item {
            background: blue;
        }
    }
}

Everything seems to be ok, right? Easier nowhere.
But no. Chrome localhost - media queries do not work correctly.
prntscr.com/a53tdm
prntscr.com/a53tqs
If you open it as a local file, then everything is ok.
What is the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jazzcatt, 2017-10-05
@jazzcatt

If the following meta tags are not specified in the head section, it may not work either.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">

D
Dmitry Antonov, 2016-02-19
@Sadist07

As I understand it, you use Less with the BEM methodology)) . what does it convert to css? what does a media query look like?

@media screen and (min-width:480px) {

}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question