References : Style sheets


Reading CSS values

  Values specified in style sheets follow a special notation. If you are not familiar with logical operations, we recommend that you study this page before starting with the reference itself.

Here are the different types of values:
  • Keywords. Keywords are identifiers such as red, auto, normal, and inherit. They are not assigned any punctuation mark.
  • Basic data types. Values such asnumber and length are enclosed by angle brackets (< >) to indicate the data type of the actual value used in a style statement. Here we are referring to the data type, not to the actual value. The basic data types are described at the end of this appendix.
  • Brief reference. The values enclosed between single quotes and angle brackets, such as <'background-color'> in the background property, indicate a quick method to define the value you want. The values identified in background-color can be used in the background property. If you prefer to define the background colour in the body of a document, for instance, you can do so using one of these two rules: body { background: red } or the body { background-color: red }.
  • Predefined data types. Values specified between angle brackets without quotes, such as border-width in the border-top-widthproperty, are similar to the basic data types, but contain predefined values. The permitted values for <border-width>, for instance, are thin, thick, medium, and <length>.

When several values are available, they are organised according to the following rules:
  • Adjacent words. Several adjacent words mean that all the values can be used in any order.
  • Values separated by a vertical bar "|". The bar separates several solutions, of which only one can be kept.
  • Values separated by a double vertical bar "||". The double bar separates several options, of which one or several can be kept in any order.
  • Square brackets "[]". Square brackets group values into instructions that will be evaluated as in a mathematical expression.

The evaluation of the values presented in this appendix follows a hierarchical sequence. First, the adjacent values are considered, then the values separated by double vertical bars and, lastly, those separated by single vertical bars.

To complete this rule, the following qualifiers can be added after each value or group of values:
  • * (asterisk). The previous type, word or group may be repeated several times.
  • + (plus). The previous type, word or group is repeated one or several times.
  • ? (question mark). The previous type, word or group is optional.
  • {} (braces). A pair of digits between braces, such as {1,2}, indicates that the previous type, word or group is repeated at least once, and at the most twice..