源元素媒体属性的所有可能值是什么?
答案 0 :(得分:1)
媒体属性给出了预期的 媒体资源的媒体类型 帮助用户代理确定是否这样 媒体资源对用户有用 在取之前。它的价值必须是 有效的媒体查询。
如果您这样做,它会引导您进入Media Queries页。
媒体类型的规范性参考是CSS2.1标准,其中规定:
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).
请注意,HTML4有不同的媒体类型列表:
'print','screen','aural','braille','掌上','print','projection','screen','tty','tv'。
答案 1 :(得分:0)
all
或media query。提供详尽的列表是不切实际的(device-width: 1px
,device-width: 2px
,device-width: 3px
等等。
答案 2 :(得分:0)
根据HTML5规范,您可以在@media
属性中输入任何有效的“媒体查询”。这包括所有常规值,例如screen
,print
等等,但您可以执行更高级的操作,如以下链接中所述:
http://dev.w3.org/csswg/css3-mediaqueries/#media0
示例:
<source media="screen and (device-aspect-ratio: 16/9)" src='video1_widescreen.ogv' type='video/ogg; codecs="theora, vorbis"'>
<source media="screen" src='video1.ogv' type='video/ogg; codecs="theora, vorbis"'>
<source media="not screen" src='video1_poster.jpg'>
答案 3 :(得分:0)
来自HTML 5 spec的草稿:
media属性提供媒体资源的预期媒体类型,以帮助用户代理在获取之前确定此媒体资源对用户是否有用。它的值必须是有效的媒体查询。
和
如果字符串与Media Queries规范的media_query_list生成匹配,则该字符串是有效的媒体查询。
媒体查询(MQ)规范是here。