What are good and bad points if i use body {font-size:62.5%}?
What are good and bad points if i use body {font-size:62.5%}
?
If body {font-size:62.5%}
has some problem then can anyon开发者_如何学Pythone suggest any other method for font sizing in site
A good point for using percentages to define font sizes is that you maintain the relative aspect ratio for all fonts when the text is zoomed in or out by the user.
Good: relative font sizes are a good thing, so that people can easily choose their preferred font size, and scale it independently of image size.
Bad: 62.5% is very small, almost guaranteeing that users will have to scale it.
Pro:
- Scales with the user settings
- Doesn't recurse (so you won't get the effect of ever smaller text if you nest elements in your body).
Con:
- The user has selected a font size in the prefs which they like and you override this. They'll hate you, since they now have to increase the font size every time they visit your site and decrease it again when they leave it.
- It will render your site unreadable for the first visit which means you'll loose 99% of all visitors.
[EDIT] You asked to explain my cons. I'm not sure what is hard to understand but here goes:
There are many people out there who never change the defaults on their computer. They don't know how and even if they did, they didn't know how to change the values to make it better. These will be irritated because your site suddenly looks different than all the other sites. They won't know how to "fix" this. It will make them frustrated -> angry -> they will hate your site -> hate everything on your site -> you loose.
Then there are people who change the defaults. Some are just fiddling with all the shiny buttons but others change the settings for a reason. They might be visually impaired, for example. The people who just found "Comic Sans/34pt" will hate you because they are so proud they found such a nice font and now your site looks so ugly.
The latter group will hate you because you make their lives miserable, reminding them of their pains (which they can't change but they can leave your site and never come back).
Then there are the users who know how to change the font size via the zoom menu. Most browsers don't reset the zoom menu when you leave the page for which you enabled the bigger fonts. So what happens? How often will users of your site come back, increase font size, leave, make it smaller again, come back ... One? Twice? Never?
Lastly, a lot of people will just don't bother. They'll visit your site, see that it's hard to read and not even bother to figure out why it is. Their interest will have evaporated the moment their eyes tell them "hard to read". One click later, they'll have all but forgotten about you.
Conclusion: It's a pretty good way to make sure only really interested people visit your site. If you have a good way to find all the really interested people and point them to your site plus most of them are willing to go through the hassle to make it readable for themselves ... no, it's not even a good strategy even in this case.
Last point: It's possible that the site is still readable on your monitor because you changed the defaults or your browser ignores fronts smaller than 6 pixels but that's what most people will see: A site with 7 pixel fonts. The site in front of you has 13.7px font size (on Linux). That's very readable. 7px is just too small.
[EDIT2] It seems that you assume that all browsers use the same font. This is absolutely wrong. See http://css-discuss.incutio.com/?page=FontSize to get some idea what kind of mess we're talking about here.
It will make your body scale according to the client's browser settings. So the font will be 62% smaller than his default font size (but not smaller than what he set as minimum font size in his preferences). It is good from the point of accessibility (don't use pixel size for fonts), but you can not assume that text will have a certain size, as you would if you used pixels (so your layout will be more variable, according to the users' device).
Pro: relative sizes make for good accessibility.
Con: it usually requires your site to be in relative sizes. This can be a bit of a hassle because of rounding problems and rendering quirks.
In most browsers, it’ll make the default font size for the page 10 pixels (because most browsers have a default font size of 16 pixels, and 16 * 0.625 = 10.)
Some CSS guys really like this, because when they specify the font size for individual elements in ems (which they do so that IE users can still change the font size of the site if they want to), there’s an obvious correlation between the size in ems and the size in pixels:
1em = 10px (10 *1)
1.1em = 11px (10 * 1.1)
1.2em = 12px (10 * 1.2)
Easier to remember when you’re translating between PhotoShop designs and CSS.
I personally prefer the font size on the body
tag to be the most frequently occurring font size in the designs.
For example, if most of the text on the site should be 12px, I like the body’s font size to be that (i.e. 75%), so that for most elements, I don’t have to set the font size at all, I just let it inherit the default.
精彩评论