Tying It All Together


The following are examples of how to read the syntax shorthand. The first example is of the line-height property.

Name:

line-height

Value:

normal | <number> | <length> | <percentage>


In this case, there is only one value, but it can be either the keyword normal or a number, length, or percentage. Here are some example style rules that use the property:

 P.intro { line-height: 14pt } DIV.warning { line-height: normal } H1, H2, H3 { line-height: 1.0 } H4 { line-height: 120% } 

The second example comes from the text-decoration property, which we discussed in Chapter 5. This example uses the single vertical bar, double vertical bar, and regular brackets.

Name:

text-decoration

Value:

none | [ underline || overline || line-through || blink ]


This is interpreted as follows:

  1. The value is either the keyword, none, or one or more of the keywords in the group within the regular brackets.

  2. If you choose none, you're done. If you choose the bracketed group, you have other choices. The group has four keywords. The double vertical bars indicate that one or more of these must occur. If you choose more than one, the order in which they are used doesn't matter.

Thus, there is a large number of possible values. Here are some of them:

  • underline overline

  • overline underline

  • none

  • underline blink line-through

  • blink

Because the order of the keywords doesn't matter for the text-decoration property, there are really only 15 different decorations you can set with it, but you can write some of them in more than one way.



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net