This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > December 2005 > font size relative to "top level" font size





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author font size relative to "top level" font size
Achim Domma (SyynX Solutions GmbH)

2005-12-14, 6:24 am

Hi,

is there a possibility to set the font size to a percent value of the
"top level" font size?

For example:

The font size of the body might be 100% and I have a div which should
have a font size of 80% of this value, independent of other tags around
this div:

<body style='font-size: 12pt'>
<div style='font-size: 90%'>
<div style='???'>text with a size of 80% of 12pt, independent
of the 90% of the parent div</div>
</div>
</body>

regards,
Achim
Stan Brown

2005-12-14, 8:00 pm

Wed, 14 Dec 2005 12:16:30 +0100 from Achim Domma (SyynX Solutions
GmbH) <achim.domma@syynx.de>:
> is there a possibility to set the font size to a percent value of the
> "top level" font size?
>
> For example:
>
> The font size of the body might be 100% and I have a div which should
> have a font size of 80% of this value, independent of other tags around
> this div:


Nope -- no way. It would be useful in some circumstances, but each
element inherits its base size for %age calculations from its parent.
http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size

CSS does have absolute font size like "medium", but you don't want to
use them because you have no idea what size the user has set up in
the browser.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/20...e_wont_help_you
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews