Chapter 9
Controlling Text with Cascading Style Sheets
Downloads
- Chapter 9 Files (82 kb, .zip)
- All Chapter Files (1 Mb, .zip)
Chapter 9 Overview
When the World Wide Web first launched, Web pages contained only text. But since it's part of human nature to want more, we soon wanted to build more involved Web sites. To help us, the World Wide Web Consortium (W3C) (www.w3c.org) added functionality to HTML.
As we became more skillful Web builders, our expectations (and those of our employers) increased. Technology developed to support tables, then frames and scripting languages, and we used this technology in our efforts to code better looking pages. However, we faced a problem: HTML wasn't originally designed to control the look of a pageit was intended to define the structure of the content. This led to layout inconsistencies among browsers that required yet more complicated coding to fix.
In December 1996, the W3C released its first specification for the language known as cascading stylesheets (CSS Level 1). Cascading stylesheetsalso referred to as CSS, or just stylesheetsprovide a much more effective solution for controlling things like fonts, colors, and other style properties on your Web pages.
Instead of using HTML tags, complex tables, or spacer images, CSS allow you to separate the formatting properties (font types, colors, spacing, etc.) from the structure (HTML) of your document. Separating formatting from structure makes it much easier to build and maintain numerous pages and allows you much better control over the style of your pages as well.
In this chapter, you'll focus on the portion of CSS technology that controls how text appears on your site. Dreamweaver 4 offers a great toolset for working with CSS. Below is a more detailed overview of what's covered in this chapter:
- An Introduction to CSS
- CSS Selectors, Style Definitions, and Rules
- Incorporating Styles and Style Sheets
- Applying Styles
- Modifying Existing Styles