By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

Does 1em = 100% ?

P: n/a
If I have a style:

body
{
font-size: 1em;
}

Is that any different than:

body
{
font-size: 100%;
}

Regards,
Peter Foti
Jul 20 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
Peter Foti wrote:
font-size: 1em;
Is that any different than:
font-size: 100%;


Technically they mean the same (just as 1m is the same as 100cm). In
practise, different browsers have different bugs relating to them.

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #2

P: n/a
"Peter Foti" <pe****@systolicnetworks.com> wrote:
font-size: 1em; vs. font-size: 100%;

for body.

By the specification, there is no difference, since for the font-size
property, both the em unit and percentages are relative to the font-size
of the enclosing element.

Browsers have some bugs and deficiencies for both, but on the average,
percentages are a little safer.

But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If
you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3

P: n/a
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If
you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.


I read somewhere in this newsgroup that setting the font size to 100% takes
care of some IE 5.5 bugs.

Peter

Jul 20 '05 #4

P: n/a
Peter Foti wrote:
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If
you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.


I read somewhere in this newsgroup that setting the font size to 100% takes
care of some IE 5.5 bugs.


The bug in question is related to setting font sizes in em units and
affects multiple WinIE versions, not just 5.5. If you aren't using em
units for font-size, there is no real reason to set body text size.

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #5

P: n/a
"kchayka" <kc*********@sihope.com> wrote in message
news:3f***********************@news.twtelecom.net. ..
Peter Foti wrote:
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.


I read somewhere in this newsgroup that setting the font size to 100% takes care of some IE 5.5 bugs.


The bug in question is related to setting font sizes in em units and
affects multiple WinIE versions, not just 5.5. If you aren't using em
units for font-size, there is no real reason to set body text size.


So, for instance, if I wanted to set my <h1> elements to have a font size of
2em, then I *should* set the body to have a font size of 100%, correct?

Thanks,
Peter


Jul 20 '05 #6

P: n/a
On Tue, 4 Nov 2003 13:23:49 -0500, "Peter Foti"
<pe****@systolicnetworks.com> wrote:
If I have a style:

body
{
font-size: 1em;
}

Is that any different than:

body
{
font-size: 100%;
}


They should be identical. And should also be identical to not defining
any font-size at all. And are identical in decent browsers.

But some (all? I'm not sure) versions of IE screw up if you subsequently
define other relative font sizes - it produces differing results for the
three cases.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #7

P: n/a
"Peter Foti" <pe****@systolicnetworks.com> wrote:
"kchayka" <kc*********@sihope.com> wrote in message
news:3f***********************@news.twtelecom.net ...
Peter Foti wrote:
> "Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
> news:Xn*****************************@193.229.0.31. ..
>> But what would be the point of setting font-size of body to 1em or to
>> 100%? That would just tell the browser to use whatever it does anyway.If >> you think there is a particular trick (maybe intended to overcome a
>> browser bug) involved, please explain.
>
> I read somewhere in this newsgroup that setting the font size to 100%takes > care of some IE 5.5 bugs.


The bug in question is related to setting font sizes in em units and
affects multiple WinIE versions, not just 5.5. If you aren't using em
units for font-size, there is no real reason to set body text size.


So, for instance, if I wanted to set my <h1> elements to have a font size of
2em, then I *should* set the body to have a font size of 100%, correct?


Not quite.

If you want your h1 to appear twice the user's chosen default, even
when they are using Windows IE and when they're chosen default is
something other than 'medium' then you either:
need to set body to 100% and h1 to 2em
or
set h1 to 200%.

If you have Windows IE handy you can see this effect on
http://steve.pugh.net/test/test47.html (note that the comments about
Opera and percentage sizes don't apply to recent releases).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #8

P: n/a
"Steve Pugh" <st***@pugh.net> wrote in message
news:df********************************@4ax.com...
If you want your h1 to appear twice the user's chosen default, even
when they are using Windows IE and when they're chosen default is
something other than 'medium' then you either:
need to set body to 100% and h1 to 2em
or
set h1 to 200%.

If you have Windows IE handy you can see this effect on
http://steve.pugh.net/test/test47.html (note that the comments about
Opera and percentage sizes don't apply to recent releases).


Fascinating! For the longest time I have been hearing that ems were the
best unit to use. It seems that is not so. I'll be switching to
percentages.
Thanks!

Peter

Jul 20 '05 #9

P: n/a
Peter Foti wrote:

I read somewhere in this newsgroup that setting the font size to
100% takes care of some IE 5.5 bugs.


And exposes the site to a new bug in NS4, so do hide it from that
browser if you use it.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #10

P: n/a
Peter Foti wrote:
"Steve Pugh" <st***@pugh.net> wrote in message
news:df********************************@4ax.com...
If you want your h1 to appear twice the user's chosen default, even
when they are using Windows IE and when they're chosen default is
something other than 'medium' then you either:
need to set body to 100% and h1 to 2em
or
set h1 to 200%.

If you have Windows IE handy you can see this effect on
http://steve.pugh.net/test/test47.html (note that the comments about
Opera and percentage sizes don't apply to recent releases).


Fascinating! For the longest time I have been hearing that ems were the
best unit to use. It seems that is not so. I'll be switching to
percentages.
Thanks!


think about it...em means relative to the default font size in a way that
can be transferred to elements of the page OTHER than the test...that's
what em is for...for instance em is ideal for setting margins that are
proportional to the font size, or setting the size of a box containing
some text

--
eric
www.ericjarvis.co.uk
"live fast, die only if strictly necessary"
Jul 20 '05 #11

P: n/a
"Brian" <us*****@julietremblay.com.invalid-remove-this-part> wrote in
message news:wmWpb.106522$HS4.889550@attbi_s01...
Peter Foti wrote:

I read somewhere in this newsgroup that setting the font size to
100% takes care of some IE 5.5 bugs.


And exposes the site to a new bug in NS4, so do hide it from that
browser if you use it.


Yep, I finally reached the point where I don't care to support NN4 anymore,
so I will just write clean code and it will appear non-styled in NN4 (I will
@import my style sheet). :)

-Pete
Jul 20 '05 #12

P: n/a
On Tue, 04 Nov 2003 23:11:25 GMT, Brian
<us*****@julietremblay.com.invalid-remove-this-part> wrote:
Peter Foti wrote:

I read somewhere in this newsgroup that setting the font size to
100% takes care of some IE 5.5 bugs.


And exposes the site to a new bug in NS4, so do hide it from that
browser if you use it.


Do people still use NS4, if so why?

Why havent they gone to NS7 ?

is NS really any competition for IE?
Jul 20 '05 #13

P: n/a
> Do people still use NS4, if so why?
I work in Ottawa, ON and deal a lot with the Canadian federal
government. I have seen plenty of computers with NS4.7 as the default
browser, and plenty of people who have no idea about installing new
browsers, why updating your browser is important, etc.

Also, b/c of standardization, people cannot update their software unless
*everyone* in the department gets the update, and NT controls require a
sysadmin to do it.
Why havent they gone to NS7 ?

I think some people updated to NS6, saw it was a slow-loading, buggy
piece of shit, and downgraded back to NS4.X and swore off the new,
full-of-chrome NS versions.

Jul 20 '05 #14

P: n/a
Harag <ha***@softGETRIDOFCAPLETTERShome.net> wrote:
Do people still use NS4, if so why?


I know someone who still uses NN3 because he prefers certain UI features
that are not available in later versions of NN. It isn't hard to believe
that some people use NN4 because they prefer its UI.

And I know a *lot* of people who just use whatever software was installed
on their computer when they bought it, and don't give a thought to
upgrading anything (except maybe buying a new version of their tax software
each year). So if their computer came with NN4 installed...

And I've worked for large companies with centralized IT services, where
individual users cannot upgrade the software on their computers, and where
the officially sanctioned versions of software have been a version or two
behind the latest release.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"We are Microsoft. Resistance is futile. You will be assimilated."
Jul 20 '05 #15

P: n/a
On Wed, 5 Nov 2003, Darin McGrew wrote:
And I've worked for large companies with centralized IT services, where
individual users cannot upgrade the software on their computers, and where
the officially sanctioned versions of software have been a version or two
behind the latest release.


Also note that once an academic course has been designed, there may be
a stop on browser upgrades until the end of the semester - or even the
end of the current AY. "Just in case" it breaks something (remember,
course lecturers are rarely web design experts, and the web site they
stitched together for their course may very well rely on a string
of browser bugs not getting fixed...).
Jul 20 '05 #16

P: n/a
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> schrieb im Newsbeitrag
news:Pi*******************************@ppepc56.ph. gla.ac.uk...
On Wed, 5 Nov 2003, Darin McGrew wrote:
And I've worked for large companies with centralized IT services, where
individual users cannot upgrade the software on their computers, and where the officially sanctioned versions of software have been a version or two behind the latest release.


Also note that once an academic course has been designed, there may be
a stop on browser upgrades until the end of the semester - or even the
end of the current AY. "Just in case" it breaks something (remember,
course lecturers are rarely web design experts, and the web site they
stitched together for their course may very well rely on a string
of browser bugs not getting fixed...).


As long as big ISPs still deliver NN4 with their starter kits (I've seen
this some weeks ago at Switzerland's biggest provider's store...) it will
not die and we won't be able to convince people that it's time to upgrade.

--
Markus
Jul 20 '05 #17

P: n/a
Just discovered this one in my outbox...

On Wed, 05 Nov 2003 16:40:55 +0000, Harag
<ha***@softGETRIDOFCAPLETTERShome.net> wrote:
On Tue, 04 Nov 2003 23:11:25 GMT, Brian
<us*****@julietremblay.com.invalid-remove-this-part> wrote:
Peter Foti wrote:

I read somewhere in this newsgroup that setting the font size to
100% takes care of some IE 5.5 bugs.
And exposes the site to a new bug in NS4, so do hide it from that
browser if you use it.


Do people still use NS4, if so why?


I still get about 3% NN4 visitors to my site.
Why havent they gone to NS7 ?


Maybe they've got an older computer where Netscape 7 doesn't run at an
acceptable speed. (Or at all).

Maybe they've had so many software "upgrades" that were worse than the
previous version that they don't see the point.

Maybe a 15Mb download (or whatever it is now) just costs too much in
telephone ticks.

Who knows ...

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.