css3 media
The W3C lists ten media types in total, as shown in the table:
all | 所有设备 |
Braille | 盲人用点字法触觉回馈设备 |
Embossed | 盲文打字机 |
Handheld | 便携设备 |
打印用纸或打印预览视图 | |
Projection | 各种投影设备 |
Screen | 电脑显示器 |
Speech | 语音或音频合成器 |
TV | 电视机类型设备 |
Tty | 使用固定密度字母栅格的媒介,比如电传打字机和终端 |
Among them, screen, all, and print are the most Three common media types.
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">
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">
@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;
The other is to introduce it in the tag