3 replies [Last post]
michaelthorn
Offline
Regular
Last seen: 15 years 18 weeks ago
Joined: 2004-09-06
Posts: 15
Points: 0

Hey there im a newbie... so here goes with my question:

I have a web site that uses a style sheet (style.css), what i want is a link on the site that changes the style sheet to say style2.css. The reason for this is so that the people using the site can change the css to one that has a larger font size... hence meaning someone with a vision imparement can increase the size of the text!!! With this i also need to use cookies (which i have never used before) so that when the page is changed the selected css is still being used....

any help wld b very much appricated...

of course as an addition... if when the link to increase font size is clicked and then new style sheet is applied the text changes to "decrease font size"..... if u know what i mean Wink

cheers

briski
briski's picture
Offline
Elder
London
Last seen: 10 years 2 weeks ago
London
Timezone: GMT+1
Joined: 2004-02-16
Posts: 1066
Points: 0

User changing a site css and use of cookies (yum yum)

Guy
Guy's picture
Offline
Enthusiast
Cambridge, UK
Last seen: 11 years 1 week ago
Cambridge, UK
Timezone: GMT+1
Joined: 2004-04-26
Posts: 54
Points: 0

User changing a site css and use of cookies (yum yum)

You'll need some server side scripting to do this properly! You can do it in javascript as shown in the article from ala, but think of the poor clients not enabling javascript :-({|= . I have used this javascript method before though, and it does work nicely.

Guy

Who discovered we could get milk from cows, and what did he THINK he was doing at
the time? - Billy Connolly

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

User changing a site css and use of cookies (yum yum)

If you can run PHP then a simple styleswitcher script will be easy to setup, there are pleanty at hotscripts.com and I think there is a ALA article on php switching.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me