Pete Harrison wrote: > I'm sorry David, I do not understand what you are saying here. > > Is the use of ems just a gimmick? > > What has the margin size got to do with my question. I was asking about > nested elements > > Regards > Pete > > 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. >> >> Please help >> >> Regards >> Pete >> >> >> > > > 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 > > Best, > > ~dL > > >
The use of ems is /not/ a gimmick. It is a perfectly valid and appropriate way to set fonts. And margin size has nothing to do with your question (I see now that that confused the issue). It is the use of body {font-size:62.5%;} that is problematic and sometimes yields erratic values for users who may have a minimum font-size of 24px set in the Geckos or those who really stress test a page with Opera set at a /minimum/ font-size of 50px; and those who really "bang" the + or - font discretion available to those using compliant browsers. Primarily one never knows if an IE user is running in "Accessibility" mode and ignoring your font-specification, altogether. Or conversely, if an IE user has chosen to set their browser to render font-sizes at one of the five settings other than "medium." You'll get better and more consistent results, regardless of any particular user setting by /not/ modifying default on the body and then attempting to compensate by modifying individual selector values such as making p {font-size:1.2em;}. Of course, I am stressing extreme examples; but, one never knows what a user may do-- best test at all levels and push the envelope. Because if you don't, you can count on the fact that someone else will. You can't control what users may do. You can work with users though, and that is always beneficial-- for you and for them. Some of us believe one should not make the primary content p anything less than default (medium/100%/1em/16px). But if you are bound and determined to do that when using ems, then it is the p selector that is reduced-- not the users default-- for example: 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 #primary-content p {font-size : 0.95em; } <--- the p font-size is reduced. Inheritance can sometimes prove difficult with any method. But it is far more difficult when you arbitrarily modify a users default. And the on screen results are often far less satisfactory Font-sizing is, as with most things, a matter of opinion. But /some/ opinions are better than others. It is your call to decide what the font-sizes should be. *Or, is it your user's call?* Regards, ~dL -- http://chelseacreekstudio.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/