Is there no difference between No media and media=“all” in css link?

后端 未结 3 1408
一生所求
一生所求 2021-01-04 13:33

Is there no difference between No media and media=\"all\"?


相关标签:
3条回答
  • 2021-01-04 14:30

    In HTML 4.01, the default value is screen.
    In HTML5, the default value has been changed to all.

    Therefore, it depends on the doctype declaration you use in your page. Never mind, user agents get confused about standards anyway; see Knu's comment. (I bet this is why they changed it to all in HTML5.)

    Then again, this only really matters if you're supporting user agents that don't present pages on digital screens, or display any visual information for that matter.

    0 讨论(0)
  • 2021-01-04 14:32

    Both yes and no it seems. In section 14.4.1 in the specs it says that a stylesheet without a media-type applies to all medias, whilst the other are filtered out when not needed. But in section 14.2.3 it should default to screen, which should be used on non-paged computer screens whilst all should be suitable for all devices (more information on media-descriptors here).

    0 讨论(0)
  • 2021-01-04 14:37

    Media refers to at which the css file applicable eg: screen, print etc.. Default is all. Means if you don't specify any media the parser take it as all

    Documentation

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