Thursday, July 31, 2008

em-based design? Mai tarziu!

OK, azi tocmai am mai amânat cu un proiect momentul în care layout-urile mele vor fi cu adevărat fluide. De ce? Designul em-based mă pune în dificultate acum prin simplul fapt că totul e relativ... prea relativ să nu îl dau eu peste cap!

Elastic design uses em values for all elements. Ems are a relative size, written like this: 1em, 0.5em, 1.5em etc. Ems can be specified to three decimal places like so: 1.063em. “Relative” means:
  1. They are calculated based on the font size of the parent element. E.g. If a div has a computed font size of 16px then any element inside that layer —a child— inherits the same font size unless it is changed. If the child font size is changed to 0.75em then the computed size would be 0.75 × 16px = 12px.
  2. If the user increases (or decreases) text size in their browser, the whole interface stretches (or shrinks.)

Maybe next time!

0 comments: