Appendix B. Reading Property Value Definitions


The box on page 95 describes how to read CSS property definitions. One of the fields, however, was omitted because explaining it requires a few pages. The Value field is written in a formal syntax to ensure preciseness, but the end result isn't always readable to humans. This appendix describes how to read the Value field.

Here is an example of a property defininition.

Name:

font-style

Value:

normal | italic | oblique

Initial:

normal

Applies to:

all elements

Inherited:

yes

Percentages:

N/A


The Web sites of the vendors are http://www.microsoft.com http://www.mozilla.org http://www.opera.com http://www.apple.com http://www.yeslogic.com


The "button bar" on the left side indicates how major browsers support each property. The browser categories are IE6 (Microsoft Internet Explorer for Windows, version 6), FF (Firefox version 1.0), Op7 (Opera version 7.2), Sal (Safari version 1.0), and Pr4 (Prince version 4). The first four products are browsers, and Prince is a CSS formatter that prints HTML and XML documents.

The buttons have the following meaning:

The property is not supported by the browser.

The property is partially supported by the browser.

The property is, for most practical purposes, fully supported by the browser.

"Index dot CSS" is available from http://www.blooberry.com/indexdot/css/index.html


For more detailed information about browser support, Brian Wilson's "Index Dot CSS" is the best source. For example, it tells you how the Mac version of IE4 differs from the Windows version. The buttons on the left indicates to what extent major browsers support the property. See the separate box on what the abbreviations and buttons mean.

The Name field is the first field in the formal definition. It simply lists the name of the property.

The Value field gives the possible values of the property. The previous example says that this particular property accepts one of three keywords as value: normal, italic, or oblique.

If a property offers many possible values or many possible complex combinations of values, you may find square brackets, vertical bars, and other symbols in this area. The syntax is defined in a shorthand notation using certain symbols:

  • Angle brackets: < and >

  • Vertical bars: | and | |

  • Regular brackets: []

  • Question mark: ?

  • Asterisk: *

Keywords are also used. A keyword is a word that appears in a value. Keywords must appear literally, without quotes, angle brackets, or other marks. Examples are italic, oblique, thick, thin, and medium. The slash and comma also must appear literally when used in a value.

When these symbols are used in this shorthand, they have special meanings. All other characters that appear in a value stand for themselves. Note that spaces may be inserted between all values; they can also often be omitted, as long as the result is unambiguous. Here is an explanation of what each symbol means:

Angle brackets < > The words between the angle brackets < and > specify a type of value. The most common types of values are length (<length>), percentage, color, number, and url. We discuss most of these in this chapter. We talked about url in Chapter 1, "The Web and HTML," and we dealt with color in Chapter 10, "Colors."

More specialized types include some you've already seen: font-weight, text-align, font-style, text-decoration, and background. We describe these under the properties to which they apply in Chapters 4 8. For example, if the definition of a property (let's take the color property as an example) includes this line:

Name:

font-style

Value:

<color>


It means that the property accepts values of type color, for example red. As a result, in the style sheet, you might find

 H2 { color: red } 

The url value is handled a little differently from the others. Instead of simply typing a URL, you type url followed by the actual URL in parentheses, with no space between the two: url (images/tree.png) or url (http://www.w3.org/pub/WWW). Here is an example of its usage:

 BODY { background: url(bg/marble.png) } 



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