Cascading Style Sheets (CSS)

Monday May 14, GTC West, Class P20

CSS Syntax

selector { property: value; }

Attaching CSS

<style>
@import url('styles.css');
</style>

CSS Selectors

tag
.class
#id

CSS Units

em for text
px for rest

Right Column

CSS Controls: Values and Units

  • Numbers
    • 1
    • 3.5
    • -42.5567
  • Percentages
    • 13%
  • Colors
    • 17 official names (fuschia, gray, etc.)
    • 100+ unofficial?
    • RGB: rgb(255,255,255)
    • Hex: #FFFFFF
  • Length / Size
    • Absolute Measurements:
      • Useful: Pixels* (px)
      • Not so useful; Inches, Centimeters, Millimeters, Points, Picas
    • Relative Measurements:
      • Useful: Em height (em)
      • Not so useful: Ex height (ex)
  • CA Standards:
    • px for most things
    • em for text size