...

View Full Version : how are sites letting users choose font-size?



CeeN
09-20-2005, 03:08 PM
I have seen this on http://www.anandtech.com. They have buttons that let users choose a larger or smaller font-size. How is this done?

Auriga
09-20-2005, 03:09 PM
Somekind of Javascript coding...how i'm not sure though.

EDIT: This may help, scroll down to the second posting...clicky clicky (http://www.webmasterworld.com/forum83/7337.htm)

mark87
09-20-2005, 03:43 PM
Yes, http://www.anandtech.com/ is using javascript to change the stylesheet. The different stylesheets contain the different font sizes.

You do not need to do it this way though - multiple stylesheets could be a bit annoying.

An easier method would be to make the font size of a certain element bigger -

<a href="#" onclick="document.getElementById("content").style.fontSize='12pt'">

Auriga
09-20-2005, 03:44 PM
Heh, easier than i thought it would be.

bazz
09-20-2005, 06:00 PM
you can do it with css so that they can select whatever size of text they would like.. try it with this site (CodingForums), and change your browser text size or, hold te control button as your roll your mousewheel.

Bazz

felgall
09-20-2005, 10:27 PM
Of course anyone can override the font sizes on any web page simply by creating their own stylesheet on their computer and telling the browser to use that instead of the one supplied by the site.

bazz
09-21-2005, 12:00 PM
Of course anyone can override the font sizes on any web page simply by creating their own stylesheet on their computer and telling the browser to use that instead of the one supplied by the site.

I didn't know that. :cool: I wonder, though, why should they have to do that if the site is coded as well as it could be.

bazz

felgall
09-22-2005, 12:10 AM
Example:

Someone who is partially blind may only be able to read text on their screen that displays in 72 point or greater. They can define their own stylesheet to force all web pages to display their content at that size.

Another example:

Someone wo prefers to see consistency in web pages may define their own stylesheet so that ALL web pages are displayed using the user selected layout.

bazz
09-22-2005, 10:39 AM
yeh, I can see that some people may have a need for such things. However, (in my ideal world :) ), I also think that that would not be needed if sites were properly coded. Couldn;t the user, then, not set their browser text size and this would then apply to all sites?

I am interested in the other scenario you mentioned. Specifically how to layout websites consistently, with my own stylesheet, where different sites use different id and class names.

were I to understand such a thing, I could use it.

bazz



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum