whats wrong with the media query?

后端 未结 1 1420
一生所求
一生所求 2021-01-22 12:58

W3C standards doc says:

User agents are to represent a media query as "not all" when one of the specified media features is not known.

相关标签:
1条回答
  • 2021-01-22 13:20

    The unknown media feature that the example is referring to is max-weight. Once that is encountered, the 3kg value is no longer relevant since it will never be applicable anyway, because the browser won't know what to do with max-weight in the first place. So it skips that media query altogether, leaving you effectively with this:

    <link rel="stylesheet" media="not all, (color)" href="example.css" />
    

    Which is the same as this:

    <link rel="stylesheet" media="(color)" href="example.css" />
    

    Media features are described in another section. The first sentence states:

    Syntactically, media features resemble CSS properties: they have names and accept certain values.

    So it only makes sense to describe error handling of the media features themselves first, then handling of their values.

    0 讨论(0)
提交回复
热议问题