<< prev next >>
Why use CSS?

  • Styles Solve a Common Problem
    • The line between content and presentation was blurred as Netscape and Internet Explorer began to add more tags and attributes to the original HTML specifications.
    • The World Wide Web Consortium (W3C) created Styles in addition to HTML 4.0 to solve this problem.
  • Style Sheets Can Save a Lot of Work
    • Styles can be stored externally in CSS files
    • Allows developers to control the style and layout of multiple Web pages all at once
  • Multiple Styles Will Cascade Into One
    • Style Sheets allow style information to be specified in many ways; inside a single HTML element, inside the <head> element, or in an external CSS file.
    • Multiple external Style Sheets can be referenced inside a single HTML document.
    • What style will be used when there is more than one style specified for an HTML element?
      General Cascading Order
      1. Browser default
      2. External Style Sheet
      3. Internal Style Sheet (inside the <head> tag)
      4. Inline Style (inside HTML element)