Cascading Style Sheet (CSS) Summary

Style rules can control the appearance and placement of objects on the page: Fonts, Text, Color, Borders, Images and White Spaces. Read more at w3c.org/styles

  • CSS Rules are written within the open and close style element
    <style type="text/css"> style rules </style>
  • Selector: curly braces property colon value
    p {font-weight:bold}
  • Local or Inline style rules are placed within the XHTML element.
    <p style="text-indent:.50in">
  • Embed style rules are placed in the head element within the style element.   <style type="text/css"> style rules </style>
  • Linked style sheet contains CSS rules -selector, property and value - with no tags. Saved as a text file with the extension dot css.
  • Linked style sheets format are placed in the head:
    <link rel="stylesheet" type="text/css" href="mystyles.css">
    Web pages can have multiple linked style sheets applied.
  • CSS Div and Span are container elements to apply style rules. Div is the block level and span is an inline element.
  • Classes and Ids identify special style rules
  • CSS Border rules have three properties: Width, Color and Style
  • CSS Comments uses the C programming language format
    /* multiline comments*/   or //single line comment
  • Web Design with XHTML Part I
    Doris Cuffey, Instructor