home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Dynamic HTML: The Definitive Reference, 2rd Ed.Dynamic HTML: The Definitive ReferenceSearch this book

3.5. Of Style Sheets, Elements, Attributes, and Values

Regardless of the syntax you use to define a style sheet, the basic concepts are the same. A style sheet is a collection of one or more rules. Each rule has two parts to it:

In other words, each rule defines a particular look and feel and the item(s) in the document that are to be governed by that look and feel.

3.5.1. Style Attributes

A style attribute is the name of a (usually) visible property of a piece of content on the page. An attribute such as color can apply to any element because that color can be applied to foreground content, such as text. Some attributes, such as borders and margins, can apply only to elements rendered as blocks on the page—they have a clear beginning and ending in both the HTML source code and in the layout. In their conservative approaches to claiming standards support, IE 6 and Netscape 6 promise full implementations of CSS1 (while both browsers support a lot of CSS2). To help you visualize the range of style options available as a common denominator, Table 3-1 shows a summary of CSS1 attributes grouped by category. You can find details of all CSS style sheet attributes in Chapter 11.

Table 3-1. Summary of CSS1 style sheet attributes


Box properties

border border-right-style margin
border-top border-bottom-style margin-top
border-right border-left-style margin-right
border-bottom border-width margin-bottom
border-left border-top-width margin-left
border-color border-right-width padding
border-top-color border-bottom-width padding-top
border-right-color border-left-width padding-right
border-bottom-color clear padding-bottom
border-left-color float padding-left
border-style height width

Color and background properties

background background-image background-repeat
background-attachment background-position color

Classification properties

display list-style-image list-style
list-style-type list-style-position white-space

Font properties

font font-size font-variant
font-family font-style font-weight

Text properties

letter-spacing line-height vertical-align
text-align text-indent word-spacing
text-decoration text-transform  


Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.