本文着重于原理和如何使用。
value type的组织形式主要分为以下几种:
1. keyword values (such as ‘auto
’, ‘disc
’, etc.), which appear literally, without quotes (e.g. auto
)
2. basic data types, which appear between ‘<
’ and ‘>
’ (e.g., <length>, <percentage>, etc.).
3. types that have the same range of values as a property bearing the same name (e.g., <‘border-width
’> <‘background-attachment
’>, etc.). In this case, the type name is the property name (complete with quotes) between the brackets. Such a type does not includeCSS-wide keywords such as ‘inherit
’.
在这里对第3点解释一下:该属性名(the property name completed with quotes)下可以有多个value值,这些value值(the type name between the brackets)以某种计算法则存在
4.non-terminals that do not share the same name as a property. In this case, the non-terminal name appears between ‘<
’ and ‘>
’, as in <spacing-limit>. Notice the distinction between <border-width> and <‘border-width
’>: the latter is defined as the value of the ‘border-width
’ property, the former requires an explicit expansion elsewhere. The definition of a non-terminal is located near its first appearance in the specification.
value type的组织形式主要分为以下几种: