Jul 14, 2010

Jimi Hendrix in JavaScript




ifSixWasNine, by Jared (a.k.a. "Jimi" ;-) Hendricks

ifSixWasNine(6) ==> 9
ifSixWasNine(12) ==> 18

Exercise: Write and test this function.

Jul 12, 2010

xhtml: logical vs physical tags

HTML includes two types of Style Tags:
  • logical (a.k.a. phrase elements)
    tag the information according to its meaning (e.g., abbr, acronym, code, etc.)
  • physical
    tag the exact appearance of the information (i.e. b, i, etc.)
Both <em> and <i> display italics. CSS is the preferred way to style content rather than logical tags. Logical style tags are preferred over physical tags (which is why the latter are deprecated in xhtml).

Rationale: the goal in xhtml is to separate structure elements from style elements, and remove the latter from html. Content should be styled with CSS rather than html. Logical tags describe the structure or semantics of content and are, therefore, preferred over style elements like <b> and <i>.