Difference between revisions of "Cascade Style Sheets"

From Got Opinion Wiki
Jump to navigation Jump to search
Line 1: Line 1:
A Cascade Style Sheet (CSS) is made up of two parts: the selector and declaration.
A Cascade Style Sheet (CSS) is made up of two parts: the selector and declaration. The selector states which tag the rule applies. The declaration stats what happens when the rule is applied.


The declaration is made up of two elements: a property and value. A declaration must end with a semicolon.
The declaration is made up of two elements: a property and value. A declaration must end with a semicolon.
Line 14: Line 14:


h3 {font-style:italic;}</pre>
h3 {font-style:italic;}</pre>
Contextual selectors use more than one tag in the selector. The tag closest to the declaration is the targeted tag. The additional tag(s) state where the target tag must be located in the markup up in order for target tag to be affected. Contextual selectors have spaces between them.


<center>[[web development|Back to Web Development]]</center>
<center>[[web development|Back to Web Development]]</center>

Revision as of 11:04, 15 March 2008

A Cascade Style Sheet (CSS) is made up of two parts: the selector and declaration. The selector states which tag the rule applies. The declaration stats what happens when the rule is applied.

The declaration is made up of two elements: a property and value. A declaration must end with a semicolon.

Multiple declarations can be contained in a single rule.

Multiple selectors can be contained in a single rule. A comma must be used after each selector except the last.

h1, h2, h3 {color:red; font-weight:bold;}

Multiple rules can be applied to the same selector.

h1, h2, h3 {color:red; font-weight:bold;}

h3 {font-style:italic;}

Contextual selectors use more than one tag in the selector. The tag closest to the declaration is the targeted tag. The additional tag(s) state where the target tag must be located in the markup up in order for target tag to be affected. Contextual selectors have spaces between them.

Back to Web Development