O'Reilly logo

Dreamweaver in a Nutshell by Bruce A. Epstein, Heather Williamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Cascading Style Sheets

Cascading Style Sheets (CSS) are one of the greatest features to come out of the World Wide Web Consortium (W3C). CSS simplifies repetitive formatting tasks, such as indenting the first line of every paragraph, by defining styles to be applied within a page. Attaching the same CSS stylesheet to multiple pages (or to the template on which multiple pages are based) makes it easy to redefine styles globally throughout your site. CSS can be used to set page attributes (such as margins and background images), provide rollover states for hyperlinks, align images, and format tables.

An exhaustive discussion of CSS is beyond the scope of this book, but this chapter will give you a good overview and cover its use in Dreamweaver. For full details on CSS, see Cascading Style Sheets: The Definitive Guide by Eric A. Meyer (O’Reilly). For quick-reference information including browser, CSS1, and CSS2 support, choose O’Reilly CSS Reference from the Book pop-up menu in the Reference panel (Window Reference).

CSS Overview

Conceptually, CSS is pretty simple—you define styles that can be applied easily over one or more pages. But the details can get confusing unless you’re familiar with the terminology (especially because Dreamweaver’s terminology varies slightly from that used elsewhere). We’ll start with the big picture and work our way towards the details.

CSS Versus HTML Styles

First let’s compare CSS to so-called HTML styles (discussed in Chapter 11).

CSS stylesheets: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required