CSS值定义的语法 Value Definition Syntax

来源:互联网 发布:淘猫流量被淘宝过滤了 编辑:程序博客网 时间:2024/05/20 14:19

Component values may be arranged into property values as follows:

属性值由各组件成分组成,如下:

  • Several juxtaposed words mean that all of them must occur, in the given order.
  • 几个并列的值,必须要有,在指定的顺序。
  • A bar (|) separates two or more alternatives: exactly one of them must occur.
  • 一条(|),出两个或两个以上可选方案,其中之一必须要有
  • A double bar (||) separates two or more options: one or more of them must occur, in any order.
  • 双杆(| |),两个或两个以上的可选项,其中一个或多个必须要有,在任何顺序。

  • A double ampersand (&&) separates two or more components, all of which must occur, in any order.
  • 双与字符(& &),分两个或多个组件,所有这些都必须要有,在任何顺序。
  • Brackets ([ ]) are for grouping.
  • 方括号([])用来分组,分成子表达式。

Juxtaposition is stronger than the double ampersand, the double ampersand is stronger than the double bar, and the double baris stronger than the bar. Thus, the following lines are equivalent:

匹配优先顺序:并列 > && > || > | 。下面例子两行是一样的。

    a b   |   c ||   d &&   e f  [ a b ] | [ c || [ d && [ e f ]]]

Every type, keyword, or bracketed group may be followed by one ofthe following modifiers:

每种类型、关键字或相等的组,紧随其后的可能是接着一个特殊字符:

  • An asterisk (*) indicates that the preceding type, word, or group occurs zero or more times.
  • 星号(*),表示前面的类型,单词,或子表达式,匹配零次或更多。
  • A plus (+) indicates that the preceding type, word, or group occurs one or more times.
  • 加号(+),表示前面的类型,单词,或子表达式,匹配一次或多次。
  • A question mark (?) indicates that the preceding type, word, or group is optional.
  • 问号(?),表明前面的类型,单词,或子表达式匹配是可选的。
  • A pair of numbers in curly braces ({A,B}) indicates that the preceding type, word, or group occurs at least A and at most B times.
  • 一对数字花括号({ A、B }),表明前面的类型,单词,或子表达式两个项之间(含)进行选择。

The following examples illustrate different value types:

下面的例子说明了不同的值类型:

Value: N | NW | NE
Value: [ <length> | thick | thin ]{1,4}
Value: [<family-name> , ]* <family-name>
Value: <uri>? <color> [ / <color> ]?
Value: <uri> || <color>
Value: inset? && [ <length>{2,4} && <color>? ]



0 0
原创粉丝点击