Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

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

14.1. What Is CSS?

Cascading Style Sheets (CSS) was a standard introduced by the World Wide Web Consortium (W3C) in 1995 to help designers get more control over their Web pages by enhancing what HTML can do—it is used to stylize the content of a Web page. Whereas HTML is concerned with the structure and organization of a document, CSS is concerned with its layout and presentation, or formatting the document. In the old days, HTML tags were used to set up the structure and style of a page. If you wanted to create an H1 tag with an Arial blue font, point size 22, you would have to set the same attributes for each H1 tag in the entire document, To apply these changes to an entire Web site could be a daunting task. With CSS you can set the style once for all H1 tags and put that style definition in its own .css file. When the page is loaded the CSS style will be applied to all H1 tags in the page in one sweeping change.

Because the initial style of the content of a page is done with CSS, we’ll start there. The goal is to use CSS with the DOM and JavaScript (Chapter 15) together to dynamically change the style of the page, often called Dynamic HTML (DHTML). For a complete discussion of CSS (both CSS1 and CSS2), see http://www.w3org/Style/CSS. If you are a designer and already have a good CSS foundation, you can skip this chapter and go directly to Chapter 15, “The W3C DOM and JavaScript.”


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint