Sunday, September 9, 2007

HTML Web Design - Lesson 10

Intro. to CSS

  • CSS stands for Cascading Style Sheets.
  • Styles define how to display HTML elements.
  • Styles are normally stored in style sheets.
  • External style sheets are stored in CSS files.
  • External style sheets can save you a lot of work.
    • Use external style sheets!
What is a formal definition of CSS?
  • Language used to describe how an HTML document should be formatted.
    • Examples:
      • Setting the font name.
      • Changing font sizes.
      • Formatting table or container borders.
      • Positioning html tags.
What is the main reason I should use CSS?
  • It enables you to change the appearance and layout of ALL the pages in your web site, just by editing one single CSS document!
Where can the styles that I create be stored?
  • 3 locations:
    • External style sheet (recommended for most instances)
    • Internal style sheet (use when appropriate)
    • Inline style (use when appropriate)
What is the precedence if you are using all 3 locations for your styles?
  • Highest precedence
    • Inline style
  • Next precedence
    • Internal style sheet
  • Least precedence
    • External style sheet
How can I reference an external style sheet?
  • <link rel="stylesheet" type="text/css" href="mystyles.css" />

No comments: