Chapter BC2. Formatting with CSS

In This Chapter

  • Getting used to CSS

  • Managing color with CSS

  • Changing text fonts and styles

  • Adding borders and backgrounds to page elements

  • Building multi-column forms with floating formats

  • Creating absolutely positioned elements

XHTML is a powerful technology, but modern Web pages require a combination of XHTML and Cascading Style Sheets (CSS). This technology works alongside XHTML. While XHTML is used to provide the basic framework and content, CSS is used to specify the visual aspects of the page.

Introduction to CSS

Early forms of HTML paid very little attention to the visual aspects of page layout. The original plan was for HTML to be more tied to the meaning of page elements rather than their display. In the very early days of the Web, this was fine, but soon people wanted far more sophisticated design elements than HTML was capable of producing. Browser manufacturers responded by adding vendor-specific tags that added new capabilities but greatly complicated development efforts.

XHTML is an attempt to return HTML to its earlier simplicity. In the strict form of XHTML, all the tags that were used to directly manage the appearance of the page (tags like <font>, <center>, <b>, and <i>) are removed. Rather than having special tags indicate formatting, a new language has been devised that can provide very powerful formatting features to virtually any HTML or XHTML tag. CSS is this language.

Overview of CSS

CSS works by describing certain parts of the page (one ...

Get JavaScript® and AJAX for Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.