• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Stylin' with Style Sheets

Chapter 11. Stylin' with Style Sheets

After years of grumbling about the design limitations of HTML, and despite the debate from the old-school digerati about how HTML is a markup language, not a layout language, Cascading Style Sheets (CSS) have become a standard.

A style is a group of attributes that are called by a single name, and a style sheet is a group of styles. Style sheets simplify the formatting of text, as well as extending the kinds of formatting you can apply (Figure 11.1). When you update a style, all instances of that style are automatically updated as well.

Figure 11.1. All I had to do was create four simple styles to completely redo the look of this page (top is pre-styles, bottom is with styles). Rather than applying color, font, and text style changes by hand, I created a style sheet. (You can't specify exacting indents without using styles.)


Style sheets are used primarily to format text, although some style attributes, such as positioning, can be used to format images and other objects as well.

Tip

One of the properties that style sheets add to HTML is the ability to better control positioning of elements on the page. Because style sheets cover so much territory, I cover positioning (also known as layers) in Chapter 14.


Tip

Style sheets work only in 4.x or later browsers such as Navigator 4.5 or 6 and IE 4 or 5. Some properties of style sheets are recognized by generation 3.x browsers, but most earlier browsers simply ignore them.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint