错误的 css 媒体语法

wrong css media syntax

这里有什么问题?

<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.

试试这个

屏幕和(最小宽度:481px)和(最大宽度:959px)