Saturday, December 17, 2011

CSS: Declarations



Declarations are enclosed within curly braces to separate them from selectors. A declaration is the combination of a CSS property and value. Figure 2-3 highlights the property and value portions of a declaration.
The property appears before the colon, and the colon is used to separate the property from the value. Declarations are used to describe. What would the CSS be like if I used CSS to describe myself? It might look like the following
richard {
mood: content;
height: 6.1ft;
hair: brown;
weight: auto; eyes: hazel; belly: full;
}
A declaration is a complete instruction for styling a property of an HTML element. The whole declaration appears highlighted in Figure 2-4.
A declaration always ends with a semi-colon.
When more than one declaration or selector appears in the same rule, they are said to be grouped.

No comments: