简体   繁体   中英

CSS Media Queries - Not Working at Correct Width

I've set up a test with media queries to work like so:

@media only screen and (min-width: 650px) and (max-width: 700px) {
    #global-wrapper-cp-fefc4ea514a255df2244eaccdabbb262 * {
        background: red !important;
    }
}

However, the CSS is effective from 666px to 716px:

在此输入图像描述 在此输入图像描述

My browser is at 100% zoom, so it cannot be this. I am using Chrome extension "Browser Width".

I'm hoping this is something simple that will leave me red faced. Can anybody offer any advice? Thank you.

You have to test it inside responsive view section, currently it's showing 17px scroll-bar. After excluding this width, your media query will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM