Skip to main content

media-feature-range-notation

指定媒体功能范围的上下文或前缀表示法。

¥Specify context or prefix notation for media feature ranges.

@media (width >= 600px) and (min-width: 600px) {}
/** ↑ ↑

* These media feature notations */

范围类型的媒体特性可以使用前缀或更现代的上下文表示法来编写。

¥Media features of the range type can be written using prefixes or the more modern context notation.

由于 min-max- 都等于包含该值的范围比较,因此它们可能是 在某些情况下受到限制

¥Because min- and max- both equate to range comparisons that include the value, they may be limiting in certain situations.

message 次要选项 可以接受该规则的参数。

¥The message secondary option can accept the arguments of this rule.

fix 选项 可以自动修复此规则报告的一些问题。

¥The fix option can automatically fix some of the problems reported by this rule.

选项

¥Options

string"context"|"prefix"

"context"

媒体功能范围必须始终使用上下文符号。

¥Media feature ranges must always use context notation.

以下模式被视为问题:

¥The following patterns are considered problems:

@media (min-width: 1px) {}
@media (min-width: 1px) and (max-width: 2px) {}

以下模式不被视为问题:

¥The following patterns are not considered problems:

@media (width >= 1px) {}
@media (1px <= width <= 2px) {}

"prefix"

媒体功能范围必须始终使用前缀表示法。

¥Media feature ranges must always use prefix notation.

以下模式被视为问题:

¥The following patterns are considered problems:

@media (width >= 1px) {}
@media (1px <= width <= 2px) {}

以下模式不被视为问题:

¥The following patterns are not considered problems:

@media (min-width: 1px) {}
@media (min-width: 1px) and (max-width: 2px) {}