📅  最后修改于: 2020-10-26 04:53:07             🧑  作者: Mango
样式表的最重要特征之一是它们指定如何在不同的媒体上呈现文档:在屏幕上,在纸上,在语音合成器上,在盲文设备上等等。
当前,我们有两种方法可以为样式表指定媒体依赖关系-
使用@media或@import规则从样式表中指定目标媒体。
在文档语言中指定目标介质。
@media规则指定一组规则的目标媒体类型(以逗号分隔)。
下面给出的是一个例子-
在HTML 4.0中,LINK元素上的media属性指定外部样式表的目标媒体-
以下是一个例子-
为CSS媒体类型选择的名称反映了相关属性有意义的目标设备。它们让您了解媒体类型将要引用的设备。以下是各种媒体类型的列表-
Sr.No. | Value & Description |
---|---|
1 |
all Suitable for all devices. |
2 |
aural Intended for speech synthesizers. |
3 |
braille Intended for braille tactile feedback devices. |
4 |
embossed Intended for paged braille printers. |
5 |
handheld Intended for handheld devices (typically small screen, monochrome, limited bandwidth). |
6 |
Intended for paged, opaque material and for documents viewed on screen in print preview mode. Please consult the section on paged media. |
7 |
projection Intended for projected presentations, for example projectors or print to transparencies. Please consult the section on paged media. |
8 |
screen Intended primarily for color computer screens. |
9 |
tty Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. |
10 |
tv Intended for television-type devices. |
注–媒体类型名称不区分大小写。