Jump to content
xisto Community
Sign in to follow this  
Lozbo

Alternate Style Sheet hows that?

Recommended Posts

I know that you can declare alternate stylsheets for your pages, but i dont know how will a user change it, i mean, i know you can change styles depending on media, or even with some js or server side coding, but with pure html? how does the user set what style he wants to be displayed?

the code goes something like that:

<link title="Alternate Style" href="/alt1.css" rel="alternate stylesheet" media="screen" type="text/css" />

thanks...

-lozbo

Share this post


Link to post
Share on other sites

You need to incorporate javascript - A List Apart has a good article.

186342[/snapback]

There is no way, to my knowlege, that a user can change to an alternate stylesheet using pure HTML. For the javascript approach, use Tyssen's approach. I also think that some browsers allow the user to change stylesheets and even add personal ones, but I have yet to come across one (that has a resonable user-base) that lets me do that.

Share this post


Link to post
Share on other sites

I don't know that the user can change css files, but by the rules of the cascade, the user can override certain attributes and make their choice become the current setting. The user has the ultimate control by setting certain rules for their browser and the browser rules override the css file. This is a very important aspect of the cascade rules for disabled / visually impaired users. It allows those with handicaps to use the web because by setting the browser rules to suit their impairments, they become less impaired. For example, the font size that you want to use on your web site may be too small for those who are visually handicapped. But, by allowing the browser rules to over ride the web site css rules, the visually impaired users are better able to navigate and use your site. It is a good thing if you happen to be a user who needs the control, but it is a bummer for the web site designer.

Share this post


Link to post
Share on other sites

It is a good thing if you happen to be a user who needs the control, but it is a bummer for the web site designer.

Not really, not if you know how to make your layouts scalable/resizable.

Share this post


Link to post
Share on other sites

arboc7 : in firefox, View > Page Style > [ No Style | Default Style [ Alternate Style ] ]......I think that's how you do it, anyway. I'm too lazy to hack up a test page right now.

Share this post


Link to post
Share on other sites

alright, thanks then, i just thought that as this alternate style sheets had its own attribute declaration in the html link tag, it might have a functional way of switching those from within the html document itself, no additional scripting required... And that ALA article is going to be very helpul, thanks, ill take that js... :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.