Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change to new css file when click anchor without Javascript.

Status
Not open for further replies.

gwhitehe

Programmer
Apr 6, 2009
9
0
0
IE
Is this possible?

I have to make a site acessible to all browser users, even those with Javascript disabled.

I want to use an anchor to switch to a new CSS file without using Javascript. The new CSS file turns the page to high contrast for certain visually impaired users

It's easy enough to do with Javascript, but I can't find a way to do it without using Javascript.

I don't want to write a new page that uses the new CSS file, as this means maintaining 2 HTML files with the same information, the only difference being their CSS files.

Any suggestions greatly appreciated.
 
Hi

gwhitehe said:
It's easy enough to do with Javascript, but I can't find a way to do it without using Javascript.
It can be done only programmatically. Can be also solved with server-side script too, but HTML alone is still not enough.

Alternatively you can rely on the browsers' capability to change the style sheets. But note that such changes are not permanent, usually browser addons are needed for that. See HTML 4.01 | Style Sheets | External style sheets | Preferred and alternate style sheets for more.

Feherke.
 
Feherke

Thanks for the reply. I suspected that was the case, just threw it out there to see what came back.

Oh well, guess I'll try a different route.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top