WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Delivering alternate stylesheets

for

Number of posts in this thread: 3 (In chronological order)

From: Rich Candy
Date: Mon, Feb 24 2003 3:47PM
Subject: Delivering alternate stylesheets
No previous message | Next message →

Any views on the best way to deliver alternate stylesheets when server side
scripting is unavailable?

I can do this easily using javascript - should I go ahead on the grounds
that it will make the site more accessible to some users? Or is javascript
best avoided altogether?

Thanks

Rich




----
To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/


From: Paul Bohman
Date: Mon, Feb 24 2003 5:50PM
Subject: RE: Delivering alternate stylesheets
← Previous message | Next message →

Using JavaScript in this context isn't all bad--it will do the job for the
vast majority of users, even those using screen readers, since most of them
use Internet Explorer with JavaScript turned on.

Some people are of the opinion that JavaScript should never be used. Some of
these people are probably on this list. In my opinion, though, the only
JavaScript that I don't like is JavaScript that:
A. requires a mouse to be used for important functionality (e.g. fly-out
menus with no alternative method of accessing the menu items)
B. causes confusing or unpredictable behaviors (e.g. changes the focus
without warning, causes an ad to float across the screen, links that do
nothing when clicked except some sort of visual event, popup ads, etc.)
C. causes a site to fail when JavaScript is disabled

Assuming that you have some sort of fall-back style implemented when
JavaScript is disabled, I see no problem with using JavaScript to detect the
user's browser and serve out tailor-made style sheets. If the site layout is
completely done in CSS, then the page should at least linearize in a logical
way when JavaScript is turned off (and when styles are turned off).

So, assuming that you have planned for contingencies, my advice would be go
ahead and use the JavaScript. BUT...

There is another way that you should be aware of, which does not require
JavaScript. You can use a single style sheet for all browsers if you code
the style sheet to take advantage of browser limitations and bugs. It is
like making the multiple versions of CSS all in the same CSS file.

It takes some time and patience to learn these techniques, but they work. I
suppose that you may find that there are some circumstances which you cannot
make work in this way, but so far I haven't run across any serious
limitations yet in my own CSS work. (Or I should say that I haven't run
across any that I wasn't able to fix via some workaround.)

One resource that you can look at to find the workarounds is
http://w3development.de/css/hide_css_from_browsers/

Paul Bohman
Technology Coordinator
WebAIM (Web Accessibility in Mind)
www.webaim.org
Center for Persons with Disabilities
www.cpd.usu.edu
Utah State University
www.usu.edu

---
*Register now*
WebAIM's Online Web Accessibility Training Event 2003
at www.webaim.org/training2003/

Dates: March 31-April 18

This event offers invaluable instruction and resources for developers,
managers/administrators, and accessibility trainers. Be a part of it!
---



-----Original Message-----
From: Rich Candy [mailto: = EMAIL ADDRESS REMOVED = ]
Sent: Monday, February 24, 2003 3:43 PM
To: = EMAIL ADDRESS REMOVED =
Subject: Delivering alternate stylesheets


Any views on the best way to deliver alternate stylesheets when server side
scripting is unavailable?

I can do this easily using javascript - should I go ahead on the grounds
that it will make the site more accessible to some users? Or is javascript
best avoided altogether?

Thanks

Rich




----
To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/



----
To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/


From: Leo Smith
Date: Wed, Feb 26 2003 9:45AM
Subject: Re: Delivering alternate stylesheets
← Previous message | No next message

> Any views on the best way to deliver alternate stylesheets when
server side scripting is unavailable?

> I can do this easily using javascript - should I go ahead on the
> grounds that it will make the site more accessible to some
users? Or is javascript best avoided altogether?

As long as you meet the Section 508 criteria that documents are
readable without requiring an associated style sheet, then you
should be fine: that is, users with Javascript off will get your page
minus the css file, which shouldn't impede their access to your
content.

In addition to the excellent resource that Paul provides re:
exploiting browser css parsing bugs, here is another resource, by
Eric Meyer.

http://www.ericmeyeroncss.com/bonus/trick-hide.html

Best,

Leo.





Leo Smith
Web Designer/Developer
USM Office of Publications and Marketing
University of Southern Maine
207-780-4774


----
To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/