Previous Message
Next Message

user adjusted font sizing in browsers

Sent by Uwe Kaiser on 21 May 2005 10:10


Philippe Wittenbergh schrieb:

> One problem should be obvious however, when it comes to ems (or %). If 
> you set the base size, and the line-height of your text on the body tag, 
> and then only give a font-size for child elements, those will inherit 
> the *computed* value of line-height form the <body>
> 
> something like
> body { font: 1em/2em serif}
> h1 {font-size: 2em; }
> 
> the line-height for the h1 will be computed as 2em based on the 
> font-size of <body>
> 
> A better solution: use a numerical value for line-height
> body { font: 1em/2 serif}
> 
> Philippe


The difference between em or % and a scaling factor at the other hand
is, that you once cause the computed value to be inharited and once the
scaling factor.


body {font-size: 12px}
div {line-height: 1.5em}   /* inherited computed value= 18px */
p {font-size: 1.3em}   /* font-size= 16px, line-height= 18px */


body {font-size: 12px}
div {line-height: 1.5}      /* inherited scaling factor= 1.5 */
p {font-size: 1.3em}   /* font-size= 16px, line-height= 24px [1] */


[1] The exact line-height depends on the rounding algorithm
     of the used browser. Some displays a line-height of 23px.




regards,
Uwe Kaiser
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: