|
|
Cascading Style Sheets HTML was designed to describe content, not describe how the content looks. Up until now, most Web developers have used "work around" HTML techniques to improve the looks of their Web pages, but the new XHTML standards are forcing the move to CSS. Cascading Style Sheets (CSS) are a robust set of tools designed to define the appearance of Web pages by assigning styles to specific HTML tags and portions of pages. This topic is fairly advanced in the Web-authoring environment so we won't actually be "doing" CSS, but we will take some time to explore what it looks like to see CSS in action. CSS uses HTML to identify page elements. The style sheet itself is stored in the <head> of the HTML document or in a separate style sheet document. One change to the style sheet document, changes the respective tagged elements. A CSS style sheet is made up of one or more rules. Each rule is comprised of a selector which identifies the parts of a Web page that should be affected, and one or more declarations, which specify the formatting which should be applied. The following styles will illustrate this:
Applying Style Rules There are three ways in which style sheet rules can be applied to an HTML document:
Style Sheet Hierarchy Styles applied at the more specific level have more weight and override more general style sheets, that's why they have the name Cascading Style Sheets. The following list illustrates the style sheet hierarchy where items lower in the list will override items above them:
|