这里有什么问题吗?
<link rel="stylesheet" href='index-02.css'
media="screen and (min-width: 481px and max-width:959px)">
验证 this page 上的代码我收到一个错误:
Error: Bad value screen and (min-width: 481px and max-width:959px) for attribute media on element link: Expected whitespace or ) but saw a instead.
最佳答案
您的语法略有偏差。每个表达式都需要包含在括号中:
<link rel="stylesheet" href='index-02.css'
media="screen and (min-width: 481px) and (max-width:959px)">
来自documentation :
Parentheses are required around expressions; failing to use them is an error.
关于css - 错误的 css 媒体语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39424271/