homepage Welcome to WebmasterWorld Guest from 54.145.183.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
text size changer
allowing user to change text size
lazydave

10+ Year Member



 
Msg#: 2755 posted 10:34 am on Jul 2, 2003 (gmt 0)

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2755 posted 10:51 am on Jul 2, 2003 (gmt 0)

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+ Year Member



 
Msg#: 2755 posted 10:59 am on Jul 2, 2003 (gmt 0)

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2755 posted 12:00 pm on Jul 2, 2003 (gmt 0)

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

10+ Year Member



 
Msg#: 2755 posted 2:34 pm on Jul 2, 2003 (gmt 0)

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...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved