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

Chapter 4. Using CSS with HTML > Separating Appearance from Structure

Separating Appearance from Structure

Separating appearance from structure is a key concept in CSS. The basic idea is that HTML should be responsible for specifying the structural elements of a document (headings, paragraphs, lists, hypertext links, and so on), while CSS should be responsible for specifying the appearance of those elements. Both HTML 4 and XHTML are formulated to facilitate this division of labor. There are some important reasons for separating appearance from structure in HTML documents:

  • It facilitates visually richer presentations while conserving bandwidth, in that a style need only be stated once for an element and the same style sheet can be used for all the pages within a site. Web designers need no longer rely on using multiple FONT and TABLE elements to design their pages, which can be very wasteful of bandwidth.

  • It makes Web pages and sites more accessible, in that nonvisual user agents (such as a speech or Braille browser, for instance) can simply ignore the visual styling of a page, while focusing on conveying the structure and content of the document. Style sheets can also be used to provide nonvisual styling, such as providing pause lengths before and after heading elements, changes in voice tone, pitch or volume, and so on, to provide cues for how a page's content might be rendered in a speech browser, for instance, to make it more understandable.

  • It allows Web pages to be styled for multiple media. Using CSS, a single style sheet can be used both for presenting information over the Web and for printing it on a laser printer, for instance, with separate formatting specified in each case. Without CSS, you need to maintain separate documents for this. You can also specify separate styling for presentations, TV displays, handheld devices (PDAs and cell phones), and other devices, all within the same document.

  • Because a single style sheet, or set of style sheets, can be applied to multiple pages, or even to a whole site, using style sheets to control the appearance of your pages can also be much more efficient and less time-consuming for Web designers than having to change or update multiple instances of FONT elements, for instance, in multiple pages. Using styles makes enforcing a uniform look and appearance for a whole site a much more manageable task.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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