Page 5 of 16PREVNEXT

Introduction to cascading style sheets (CSS)

Web site with external, embedded, and inline style sheets

Cascading style sheets can be located in three different places in your Web site.
Callout 1 An external, or linked, style sheet (note the styles.css document in the folder list).
Callout 2 An embedded style sheet.
Callout 3 An inline style sheet.

There are three types of cascading style sheets:

  • External style sheet, which you use when you want to apply the same styles consistently across all the pages in your Web site that are linked to it. Also known as linked style sheet.
  • Embedded style sheet, which you use when you want to define styles for the current page
  • Inline style sheet, which you apply to individual elements on a page.

Each one has advantages and disadvantages, and you can use all three types in a Web site, making it easier to manage the look and feel of the entire site while also being able to control each individual element down to the letter. More about this in the next lesson.

Other benefits of CSS

There are a lot of other reasons for using cascading style sheets, including:

  • More control over the display of individual elements on a page.
  • Faster download times.
  • Easier site management.

Note     One example of why it is important to use CSS is that the FONT element has been deprecated by the World Wide Web Consortium (W3C). When the W3C deprecates an element, it means it's on its way to becoming obsolete. There will come a time when FONT tags will no longer work, and CSS will be the only way to choose how to modify the appearance of the text in your Web site.

Page 5 of 16PREVNEXT