On 2007/10/13 23:11 (GMT+0100) Pete Harrison apparently typed:

> From: David Laakso [mailto:[EMAIL PROTECTED]

>> Pete Harrison wrote:

>>> OK, I'm getting more savvy with CSS and feeling a lot more confident 
>>> with many thing I try. However, I've been looking at using EM as the 
>>> scaling factor for all my fonts and pictures for accessibility reasons.

>>> I must admit, it all seems a little difficult, especially when it comes
>>> to nested elements. If I have got this right, to simulate the following;
>>> H1=24px H2=18px P=12px

>>> I would do the following

>>> body {font-size:62.5%;}
>>> H1 (font-size:2.4em;}
>>> H2 (font-size:1.8em;}
>>> P (font-size:1.2em}

>>> However, is I have a div like #frontpagenews {font-size:2em;} with a 
>>> nested h2, the h2 would seem like it was 9px (using child*parent i.e. 
>>> 1.8*2=3.6em/36px

>>> So I would have to change all em sizes of all nested elements if I had 
>>> to make a change to just one parent!

>>> I think this is a ridiculous this to have to do so I must have got it 
>>> all wrong.

>> It does not take an advanced degree in mathematics to make words readable
>> on the screen. The method you are using is one of many such "gimmicks" and
>> while interesting they seldom deliver as promoted and are known to fail
>> user stress testing.

>> This works well across-browser when setting fonts in em:

>> html { font-size : 100%; } <!--- user default set in percent to squelch a 
>> font-scaling bug when using em in ie
>> body { font-size : 1em; } <!--- user default set in em
>> h1 { font-size: whatever em; } <!--- title font-size layout dependent
>> h2 { font-size: whatever em; } <!--- sub-title font-size layout dependent
>> #primary-content p {margin : something or other; } <!--- primary content
>> inherits  user default font-size

> I'm sorry David, I do not understand what you are saying here.

> Is the use of ems just a gimmick?

The gimmick is setting 'body {font-size: 62.5%}'. As you noticed, you
enormously complicate the use of ems for sizing *everything* when you don't
limit the application of font-size to child elements that actually contain text.

> What has the margin size got to do with my question. I was asking about 
> nested elements

That's merely one of the impacts of the gimmick. The best approach to using
ems is to forget there is such a thing as px, which means there's no need to
do any type of px to em converting.
-- 
"The basis of our Bill of Rights comes from the teachings
we get from Exodus and St. Matthew, from Isaiah and St.
Paul.                          President Harry S. Truman

 Team OS/2 ** Reg. Linux User #211409

Felix Miata  ***  http://mrmazda.no-ip.com/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to