Welcome to WebmasterWorld Guest from 54.196.147.57

Forum Moderators: phranque

Message Too Old, No Replies

text size changer

allowing user to change text size

     

lazydave

10:34 am on Jul 2, 2003 (gmt 0)

10+ Year Member



hi all

i want to put a couple of buttons on my homepage, to allow people to easily adjust the text size of the site.

SO, i was wondering which is the best way to do this?

Is it possible to somehow activate the browser view / text size options?

ta

chris_f

10:51 am on Jul 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi LazyDave,

Welcome to WebmasterWorld!

If you use relative font sizing (e.g. fronts size in "em" or percentage) then the user can do this in their browser. For example, in IE you would go View --> Text Size -->Largest. However if the site is written using "pt", "px" etc... font sizing then this does not work.

An alternative would be to have multiple stylesheets for each page and have server-side code (ASP, PHP etc...) to determine which one is to be used.

ATOB
Chris

trismegisto

10:59 am on Jul 2, 2003 (gmt 0)

10+ Year Member



Hi all.

I think you can also do this using javascript, but the best approach would be using a server side script, as chris_f suggested, because it would let you set a cookie that the browser will remember in future visits.

Hope that helps.

limbo

12:00 pm on Jul 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can have the Javascrpit makes cookies do this also. This can also be used in a number of ways to allow users to have control over a sites look & feel by using CSS.

griz_fan

2:34 pm on Jul 2, 2003 (gmt 0)

10+ Year Member



As stated by chris_f, the best way to handle this is through the use of relative font sizes to ensure that the user can choose the font size through their browser settings. But, if you want to make this functionality part of your site design, check out this article on A List Apart (http://www.alistapart.com/stories/n4switch/) which shows you how to use Javascript to switch stylesheets. Netscape's DevEdge also has a guide to this (as well as lots of other great articles on CSS).
I actually tried this for a while on my site, but wasn't too keen on increasing page size with the extra javascript and CSS, so I went back to relying entirely on relative font sizing. Still, I learned a lot from the process...
 

Featured Threads

Hot Threads This Week

Hot Threads This Month