天天看點

CSS3 media queriesSyntax

譯自 MDN https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

A media query consists of an optional media type and zero or more expressions that limit the style sheets’ scope by using media features, such as width, height, and color. Media queries, added in CSS3, let the presentation of content be tailored to a specific range of output devices without having to change the content itself.

一個媒介查詢由一個可選的媒介類型和零個或多個通過使用媒介特征,比如寬度,高度,顔色,來限制樣式表範圍的表達式組成。媒介查詢在 CSS3 中被添加,它可以讓出現的内容被裁剪到一個輸出裝置的明确的範圍内,而不用改變内容本身。

Syntax

Media queries consist of an optional media type and can, as of the CSS3 specification, contain zero or more expressions, expressed as media features, which resolve to either true or false. The result of the query is true if the media type specified in the media query matches the type of device the document is being displayed on and all expressions in the media query are true.