CSS
Formatting separated from content
  • Content: XHTML (.html)
  • Formatting: style sheets (.css)
  • Glue: class attributes 
  • Define styles once, apply everywhere.
  • DRY: Don't repeat yourself. 
XHTML Elements
  • Hierarchical elements (ex. <body> tag and <br> tag) - need an ending tag as well
  • Attributes - each starting tag can have attributes (options)
  • Entities - extra characters, like <, >, and tabs.
Why XHTML is better
HTML assumes things for you.
  • Quirkier syntax (skip end tags if you forget)
  • Attributes without values (like <select multiple>) are allowed
  • Overlap of tags allowed 
XHTML
Before CSS
1.  Special tags, like <h1> tags weren't very customizable since browser decides how to display the tags (different bet browswers and very inflexible)
2.  Lots of attributes - which were hard to change and replicated a lot.  (FYI NEVER HAVE STYLE IN HTML TAGS) 
CSS
CSS Rule
Style sheets are simply a set of rules 
  • Selector: where rule applies
  • Declaration block: styles to apply 
   Login to remove ads X
Feedback | How-To