Quick! CSS question!

Out of context: Reply #3

  • Started
  • Last post
  • 6 Responses
  • jevad0

    words guys - thanks. FOund this too:

    Depreciated and deprecated! "Well, then what is the best replacement?"¡ªThere is no single correct answer. What works best is determined by application. The ALA site for example freely "mixes 'n matches" using both .px and .em units of length. The W3C CSS2 page employs .em and % (percentage) for font-size management. To best understand the pros and cons, a better understanding of the units of measure is needed (see W3C CSS2 Specifications Section 4 CSS2 syntax and basic data types: 4.3.2 Lengths). http://www.w3.org/TR/REC-CSS2/sy… ¡ý

    There are two types of length units: relative and absolute. Relative length units specify a length relative to another length property. Style sheets that use relative units will more easily scale from one medium to another (e.g., from a computer display to a laser printer). - W3C Relative units are:

    em: the 'font-size' of the relevant font
    ex: the 'x-height' of the relevant font
    px: pixels, relative to the viewing device
    The .em unit can be troublesome, though theoretically it is ideal. Read the following em from the W3C specs and note the potential pitfalls: The 'em' unit is equal to the computed value of the 'font-size' property of the element on which it is used. The exception is when 'em' occurs in the value of the 'font-size' property itself, in which case it refers to the font size of the parent element. It may be used for vertical or horizontal measurement. (This unit is also sometimes called the quad-width in typographic texts.)

View thread