Defining the Rules

Style sheet rules are made up of selectors (the HTML tags that receive the style) and declarations (the style sheet properties and their values). In the following example, the selector is the body tag and the declaration is made up of the style property (background) and its value (black). This example sets the background color for the entire document to black.

body {background:black}

You can see that, in a style sheet, the HTML tag is not surrounded by brackets as it would be in the HTML document, and the declaration is surrounded by curly braces. Declarations can contain more than one property. The following example also sets
the text color for this page to white. Notice that the two properties are separated by a semicolon.

body {background:black; color:white}

If you want to apply the same rules to several HTML tags, you could group those rules together, as in the following example:

body, td, h1 {
background:black;
color:white
}

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Visit www.iFreeCellPhones.com for Free Cell Phones. | Thanks to Palm Pre Blog, Find Best CD Rates and Fat burning furnace