Hey guys, i’m wondering why is it bad to use pixels to specify font size. If people think its too small/too big, they can Ctrl + and Ctrl - in their browser even in IE. is there another reason why its a bad idea to use pxs?
I think the main reason is that older versions of IE would not resize text set in px. To be honest, I don’t know if it really matters these days.
I’ve never heard of such a claim before, personally i prefer px over % and em since its more consistant between the browsers i test in which are
IE 6,7,8, FF 3.6, Opera 10, Safari 5 and Google Chrome
but won’t text with a set px height appear much smaller on a high resolution screen than it would on a lower resolution screen?
If you use em, the text size will be that fraction of whatever the user has as their default text size in their browser.
I never heard that fontsize in px is bad. Where did you read this ? Do you have a source ?
Google will give you lots of references to discussions on the pros and cons of using different units for font size.
From what I’ve seen, the majority advise using em or % over pixels - but each to their own on this one
i’ve browsed abit including that website, but that website is saying that pixels could not be scaled and its bad for visuals with bad eyesight. but now with Ctrl + and Ctrl - we would not have to worry about this at all.
I use to use % for the body tag, and change everything with em afterwards. These days I only use px because it is a lot easier to have a consistent size, and it removes inheritance problems.
All modern browsers support page zooming, with still enlarge the text even if px is used. Keep you life easy, use px.
my life is easy using em.
Sorry but you’re wrong, people can’t always Ctrl + / Ctrl - to zoom the text in and out… firstly IE7’s zoom functionality is broken to the largest extent and by using that you’ll soon find that many websites are “damaged” in the process rendering the content unreadable. Even without this, IE6 doesn’t have a zoom function… how are they meant to resize text if their only method of doing such a thing cannot be achieved (because it doesn’t work on PX units). If you want your site to be accessible, you HAVE to establish non-PX units for text sizes, otherwise disabled people using IE6 will have no method to scale the size of what their reading.
It does if you want to be accessible in IE6.
Well I can vouch for the problems that PX units cause, I’ve been working with a lot of people needing accessibility aids and PX unit measurements is one of the well known methods which trips up their ability to browse a site. Apart from the fact plenty of people don’t realise zoom exists (due to being used to the text size menu option), IE6 doesn’t have a zoom function and for all versions of IE, the text size menu refuses to scale PX units.
It’s one of these fun IE6 (and older) issues. If font sizes are set in pixels, IE6 will not resize the fonts when the user tries to get larger fonts from the browser. As such, we are forced to use a few standards-compliant hacks and use EM’s instead if we want to have re-sizable text in IE6.
These days, however, IE6 isn’t the big fish it used to be. We still see 5-6% of web users using IE6, but most developers hate IE6 enough that we’re willing to see these millions and millions of people as insignificant and not bother trying to support them. YouTube gave up its support for IE6, as have many other popular websites.
Personally, I think 5-6% is still a large enough demographic to cater to, but I don’t go “all out” like I used to. One area I’ve stopped is with this text size issue. I’ve gone back to using Pixels for font sizes as it’s just a little bit easier. I’m still doing the separate IE6 style sheets and hacking in support for transparent PNGs.
In short, it depends who you’re targetting. If your website is for the older crowd (who are more likely to have an antiquated browser and will NEED the large fonts more than anyone), use EMs. If you’re targeting a younger audience (as was the case for YouTube), then you’re probably alright to forget IE6 and use Pixels.
Most if not all my clients are targeting newer browsers but I still prefer to use em’s since I don’t have any problems with em’s.