Home > Web Front-end > HTML Tutorial > css3 media note_html/css_WEB-ITnose

css3 media note_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:17
Original
1057 people have browsed it

css3 media

Media Type Media Type

The W3C lists ten media types in total, as shown in the table:

值 设备类型
all 所有设备
Braille 盲人用点字法触觉回馈设备
Embossed 盲文打字机
Handheld 便携设备
Print 打印用纸或打印预览视图
Projection 各种投影设备
Screen 电脑显示器
Speech 语音或音频合成器
TV 电视机类型设备
Tty 使用固定密度字母栅格的媒介,比如电传打字机和终端

Among them, screen, all, and print are the most Three common media types.

Media type reference method

  1. link method : introduce the media type when the tag references the style, specified through the media attribute Different media types.

    <link rel="stylesheet" type="text/css" href="style.css" media="screen">
    Copy after login
  2. xml method : Similar to the media type introduced by link, it is also specified through the media attribute.

    <?xml-stylesheet type="text/css" media="screen" href="style.css">
    Copy after login
  3. @import method: @import is one of the methods used to reference style files, and can also be used to reference types. There are two main ways to introduce media types with @import.

    One is to call another file through @import in the style file;

    @import url(style.css) screen;
    Copy after login

    The other is to introduce it in the tag