Forum Moderators: not2easy

Message Too Old, No Replies

problems with text sizes

EM's only in IE (unless im doign it wrong?!)

         

natty

5:40 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



hi all,

im having a bit of problem with text sizes in IE. i make a page, and in the css i put in the
body,html{
font-size: .9em;
}
then further on i do
#content{
margin: 10px;
/*etc*/
}

but in IE any text in the content div, is huge, and if i set a em size in there then firefox shrinks it.
am i forced to you px or pt?

or am i simply misunderstanding?

tia

nat

Emperor

7:06 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



Hi,

I've done a lot of research and experimenting on this and what I ended up doing is this:

Set the 'base' size in the body using a percentage, then use .em for the other sections.

So for your example I would do this:

body {
font-size: 90%;
}

#content {
font-size: 1.0em;
}

Or better yet...

body {
font-size: 100%;
}

#content{
font-size: 0.9em;
}

Let me know how that works out.

Take care,
Emperor

Longhaired Genius

7:25 pm on Nov 30, 2004 (gmt 0)

10+ Year Member



IE can handle font sizes in ems ok so there must be an error in your CSS (though your example seems ok).

It's not wise to put something like:

body,html{
font-size: .9em;
}

because styles cascade this means that your actual font size is going to be 0.81em.