CSS codes have two parts : the selector and the declaration has two section: the property and the value. The following illustrates the CSS format: * Selector{ property; value} * Selector would be body
The selector must come first and be followed by at least one space. The declaration is enclosed in curly brackets({}). Within the brackets, the property must come first, followed by a colon and at least one space, then the value. The following is a simple example of CSS: Body {color: black}
In this example, body is the selector( what we are controlling) and the part starting with the curly bracket, ({}) , and ending with the closed curly brackets, (}), is the declaration (what we are doing to the selector)
Within the declaration, color is the property ( the particular part of the selector we are controlling) and black is the value.( what we would like the property to be).
CSS declaration can be stacked onto one selector. If we want the background white, the text, color, color black, and the font a 123-point sans-serif, we can make multiple declarations. Separating them by semicolons. The following code shows a stacking of CSS declarations:
Body {background: white; Color: black; Font-size: 12pt; Font-family: sans-serif; }
There are three ways to include CSS information in a document: in the document head, in a separate file, and inline with XHTML.
In the Document Head If the style information applies only to one document, you would include it within the document head, enclosing it in and code so as to avoid problems with browsers that do not support CSS. To specify the background color of the document as white, we would write.
If you have style sheets information that you would apply to more than one document, it would be a waste of time to type the style information into each document. Even if you