2. CSS Basics

CSS lets you control your document’s appearance—fonts, text, colors, backgrounds, sizes, borders, spacing, positioning, visual effects, tables, and lists. However, the real advantage of using CSS instead of HTML is that by changing a few lines of code, you can change the appearance of every page on your Web site.

With savvy use of CSS, you can take a plain page of text (Figure 2.1) and add visual design and interaction that turns it into a webbed environment (Figure 2.2).

Figure 2.1. Here’s an HTML page displayed without the benefit of CSS. The page still displays, but without the formatting of Figure 2.2.

Image

Figure 2.2. An HTML page ...

Get CSS, DHTML, and Ajax: Visual QuickStart Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.