Hour Four: Using CSS with HTML
In previous hours, you've used Cascading Style Sheets to style your HTML pages by linking in an external CSS file. The true power of CSS and HTML really shines through only when you understand both of these complementary languages, how they relate to each other, and how they can be used effectively.
HTML and CSS blend together well not by coincidence but by design; they were literally made for each other. Using that designed synergy is the key to creating effective presentations on your Web sites.
In this hour, you'll learn
- What the different types of HTML are and how to use them with Cascading Style Sheets
- The three ways to link CSS to styles and when to use each
- How to create an external style sheet for your entire Web site
- How to embed style sheets directly in your HTML
- How to create CSS rules based on the HTML attributes of class and id
Sample Code
You can download the sample code from each hour as one package or individual files.
- Download all [0.5K tar.gz file]
- Listing 4.1 [HTML]
- Listing 4.2 [CSS]
Web Links
These are the links presented in this hour, given here for easy reference.
- Mozilla and Netscape "quirks" mode
- Internet Explorer 6 backwards-compatibility mode
- W3C's HTML Validator
- Web Design Group's HTML Validator
- W3C's Core Styles
- W3C's Markup page, including XHTML 2 development
Updates and Errata
There are currently no updates to this hour's content.