Subject: [css-d] Mozilla vs IE6 PC font sizing

From: Michael_Landis at capgroup.com ([email-masked])
Date: Mon, 28 Apr 2003 08:35:36 -0700

Joel Young wrote:

> So to compensate, and hopefully make IE6 behave, I did this:
>
>       body {font-size: .7em}
>       td {font-size: .7em}
>
> This puts IE6 the way I want it, but transforms Mozilla into miniscule
text
> that Superman couldn't read.
>
>
> So I tried this, thinking it would take care of both, since all I'm doing

> is styling the td's for the page, and td's are the same in all browsers -

> aren't they?....
>
>       (no body styling this time)
>       td {font-size: .7em}
>
> That looks great in IE6, and only brings Mozilla up to legible with a
> strong pair of glasses.

Welcome, Joel!

There are two tricks here:

1) IE does not inherit font sizes through the table tag, but the td tag
does inherit correctly. Instead of the body/td style combo above, try this:

    body {font-size: 70%}
    table {font-size: 100%}

This tells IE to inherit the font size through the table, which will then
allow the td fonts to size correctly. It also doesn't cause any side
effects in more compliant browsers, because 100% of 100% is, well, 100%. If
you have reasons to change font sizes for specific td's, this also lets you
do so without worrying about clobbering the browser compatibility fix.

2) Jason Estes mentioned the issue with setting font sizes in ems -- it
causes IE to do strange things when the browser is set to anything other
than "Medium". I can't agree more strongly, with respect with the body font
size. Basically, IE will misbehave if you use ems as the font-size that
everything else is relative to, so something like

    body {font-size: 0.7em}
    cite {font-size: 0.9em}

will shrink to unreadable proportions. If, however, you set your outermost
font-size using percents, you can then make all other font sizes in ems, if
you prefer reading them that way. In other words,

    body {font-size: 70%}
    cite (font-size: 0.9em}

will behave correctly.

HTH,

MikeL

---

From: mrmazda at ij.net (Felix Miata)
Date: Mon, 28 Apr 2003 17:13:32 -0400

> > This puts IE6 the way I want it, but transforms Mozilla into miniscule text

 

 

 
> you prefer reading them that way. In other words,

Since Matthew Davey started the ems or percent? thread over the weekend,
I've been playing around with IE6 off and on trying to understand the
pattern. NAICT so far, and using standards mode exclusively, IE
misbehaves on font-size inheritance under more conditions than just
tables. I just haven't found the pattern yet.

For example, at http://members.ij.net/mrmazda/auth/ie/IE6tB.html, which
has only two font-size rules applied to the whole page (table=100% &
td=.8em), upon setting IE6 to "smaller" and Gecko to 13px, the first 6
non-blank rows (1 apparent paragraph) display the same font sizes in
both Gecko and IE, since all are specified in px.

The next apparent paragraph (3 rows) match the first two rows at
13px=medium and 12px=small. In the next row, Gecko shows x-small at 10px
(leaving 9px for xx-small), while IE drops to 9px.

The 3rd apparent paragraph (3 rows) shows matches only in the first row
at 13px=medium. The next two rows exhibit the mis-sizing problem in IE,
while they display as expected in Gecko, which correctly applies .8em to
the 2nd row and .8emX.8em=.64em to the third row. Note that this
paragraph is three nested divs, no tables, and yet what IE appears to
have done is apply .8emX.8em to row two, and .8emX.8emX.8em=.51em or
.8emX.8emX.8emX.8em=.41em to row three.

Next 2 paragraphs/rows are simply for reference for what follows, but
note that .8em is smaller in IE, even though the default is the same
13px.

Last, is a three row table, with another table in the 2nd row. Again,
Gecko renders exactly as expected. In contrast, IE, which supposedly
fubars em text sizing *too small* if a % size is not set in body or html
and not set in prefs to medium, displays the first two rows, sized in
ems, *larger* than Gecko. ?!?!?!?!?!?!?
-- 
"The object and practice of liberty lies in the limitation of
governmental power."                General Douglas MacArthur

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

Felix Miata  ***  http://members.ij.net/mrmazda/auth/auth.html