Media=All vs Media=Screen

前端 未结 2 1231
日久生厌
日久生厌 2020-12-09 08:14

It seems like recently I have seen many more people starting to use media=\"all\" vs media=\"screen\" in their stylesheets.

My question is

相关标签:
2条回答
  • 2020-12-09 08:26

    According to W3C Spec:

    7.3 Recognized media types

    The names chosen for CSS media types reflect target devices for which the relevant properties make sense. In the following list of CSS media types the names of media types are normative, but the descriptions are informative. Likewise, the "Media" field in the description of each property is informative.

    all

    Suitable for all devices.

    braille

    Intended for braille tactile feedback devices.

    embossed

    Intended for paged braille printers.

    handheld

    Intended for handheld devices (typically small screen, limited bandwidth).

    print

    Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.

    projection

    Intended for projected presentations, for example projectors. Please consult the section on paged media for information about formatting issues that are specific to paged media.

    screen

    Intended primarily for color computer screens.

    speech

    Intended for speech synthesizers. Note: CSS2 had a similar media type called 'aural' for this purpose. See the appendix on aural style sheets for details.

    tty

    Intended for media using a fixed-pitch character grid (such as teletypes, terminals, or portable devices with limited display capabilities). Authors should not use pixel units with the "tty" media type.

    tv

    Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).

    0 讨论(0)
  • 2020-12-09 08:45
    media="all"    // Used for all media type devices ( its default under html 5)
    media="screen" // Used for computer screens(default value  for html 4.01)
    

    Good read

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

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