共计 1128 个字符,预计需要花费 3 分钟才能阅读完成。
你对媒体查问的了解?
简述概念
媒体查问由一个可选的媒体类型和 零个
或多个
应用媒体性能的限度了样式表范畴的表达式组成,例如宽度、高度和色彩。
媒体查问,增加自 CSS3
,容许内容的出现针对一个特定范畴的输出设备而进行裁剪,而不用扭转内容自身, 非常适合web
网页应答不同型号的设施而做出对应的响应适配。
如何应用?
媒体查问蕴含一个可选的媒体类型和,满足 CSS3
标准的条件下,蕴含 零个
或多个
表达式,这些表达式形容了媒体特色,最终会被解析为 true
或false
。
如果媒体查问中指定的媒体类型匹配展现文档所应用的设施类型,并且所有的表达式的值都是true
,那么该媒体查问的后果为true
. 那么媒体查问内的款式将会失效。
What’s your understanding of media queries ?
Introduction
The media query consists of an optional media type and zero or more expressions that limit the range of stylesheet with media function. Such as width
, height
and color
.
The media query is added from css3
, it allows the presentation of content is tailored to output devices
of a special range
without changing the content itself.
It’s very suitable for web pages
to respond to the different models of devices and make corresponding response adaptations.
How to use ?
The media query contains an optional media type
, under the conditions of the CSS3
specification, it contains zero
or more expressions
that describe the characteristics of the media and will eventually be parsed as true
or false
.
If the media type specified in the media query has matched the device type used to display the document, and the value of all expressions is true
, and then the result of the media query is true
. Then the style in the media query will take effect.