简体   繁体   中英

media query was working fine but suddenly doesn't work anymore

It worked before but all of a sudden it stopped working :(

@media only screen and (max-width: 768px) {
form,
button,
input {
     width: 80vw !important;
    }
}


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

I have html, css and js code included in the link below:

DEMO: CodePen

The problem is an invisible special character inserted into your code.

It's making the declaration invalid, which calls CSS error-handling into play, and the rule is ignored.

If you copy and paste the code into Notepad, you'll see it.

在此处输入图片说明

In computer science we call this a focused, non-repeating phantasm, or class-5 free roaming vapor... real nasty one, too! :-)

The simple solution is to just delete that media query and re-type it.

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