Monday, January 21, 2013

Misc. notes related to "CSS : Missing Manual"

Recently, I read CSS : The Missing Manual and I got to say that I was pretty satisfied. The book walks through the basics of CSS with examples. The book isn't very deep but covers well the basics.

Misc notes (mostly for myself):

Valid & good HTML & CSS:


  • Remember the basic "official things"
  • Other important things
    • Do not mix HTML & styles (no fonts etc)
    • HTML is for structure & semantics, CSS is for the layout etc
  • Maintainability : CSS class names preferably for content, not for the layout/presentation, for example:
    • use "alert" instead of "red-highlight"
    • use "news" instead of "left-side-bar"

Misc CSS/HTML notes:

  • Block-level vs inline boxes
    • Block-level (div, p, ...) : break before and after element
    • Inline elements (strong, a, ...) : no break

Position

  • absolute : one can define the position him/herself
    • relative to its absolutely positioned parent (tag with absolute, relative or fixed positioning)
    • in other words : positioned with respect to its containing block
    • absolute positioned element is removed from the HTML flow, the space is freed
  • relative : relative to elements "right place" at the HTML flow
  • fixed : fixed position at the window
  • static (the default) : element's box is generated as normal

No comments: