/    Sign up×
Community /Pin to ProfileBookmark

font size: em vs px?

Hello, I am wondering what the advantage of using em is over pixel and what benefit resetting the default font size in the body to 62.5% is. Also how come google and yahoo don’t use em or 62.5%.
thanks

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@CentauriApr 17.2008 — The advantage of setting font size in px is that you [B]know[/B] that is the size it will be (initially) displayed at - the disadvantage is that [I]stupid[/I] browsers (IE) will not allow the user to resize text specified in px.

The most common browser default text size is 16px, and setting the base size to 62.5% gives a size of 10px - this then makes correlation between ems and pixels easy to calculate (1em = 10px, 1.5em = 15px etc). Where the browser and/or user sets the default text size to anything other than 16px, these sizes will then no longer apply.
Copy linkTweet thisAlerts:
@agallochApr 17.2008 — Use em or percentages if you need the text to be resizable.

Pixels are much better though, because they're accurate, and you won't have cascading issues as you do with ems and %s.
Copy linkTweet thisAlerts:
@tiki16authorApr 17.2008 — Thanks for the replies. Is there any reason why google and yahoo haven't adopted this practise? Also, what is the point of font=100% in the html tag?

thanks
Copy linkTweet thisAlerts:
@agallochApr 17.2008 — Thanks for the replies. Is there any reason why google and yahoo haven't adopted this practise? Also, what is the point of font=100% in the html tag?

thanks[/QUOTE]


You never want to use font tag in the HTML tag. In fact, just forget about the whole font="blah blah". Just use css.

I think the reason Yahoo and Google don't have much need for ems or percentages is because their sites are mostly visited by tech savvy people. Their main audience isn't 60+ year olds who might have vision problems, and might need to enlarge their text. Just my 2 cents.
Copy linkTweet thisAlerts:
@FangApr 17.2008 — Their base font-size is px, but for the rest Yahoo use % and Google em

Due to the size and complexity of their sites no all pages will be like this.
Copy linkTweet thisAlerts:
@TJ111Apr 17.2008 — I use 100% default font size, and then size everything accordingly. Using 62.5% has some weird cross-browser quirks. Here is a great article on the topic, as well as how to fix all the little quirks and stuff. http://www.alistapart.com/articles/howtosizetextincss
×

Success!

Help @tiki16 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...