Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS media query ignored by Chrome engines

I have a stylesheet, which is essentially the following:

.mainwindow {
    .popup {
        background: black;
    }
}

@media screen and (max-width: 640px){
    .mainwindow {
       .popup {
            background: red;
        }
    }
}

It works perfectly in Firefox, IE and Edge, but not in Chrome, Brave or Electron.

Yes, I tried to clear the browser cache. It didn’t help.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

To add to the mystery, in Electron the red background flashes for a split second when starting up, then it turns to black.

>Solution :

Do you have this in the head

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

Otherwise if you are zoomed in that can stop responsive behaviour

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading