Forum Moderators: not2easy
If a visitor selects the 'visually impaired' version - what is the best method of delivering the right CSS throughout their visit to the site?
I imagine that
- a variable must be passed from page to page
- each page checks the variable and delivers the CSS accordingly
The best way to cater to the visually impaired is to write standards complient code (xhtml strict/1.1 being best) and not specifying things like fixed, non variable font sizes. Use em's instead.
If you couple the above with sensible color use and good document structure you're laughing...
Otherwise: I'll assume you're using PHP:
mysite.com?site=visual
<?
if($site=="visual") {
$added="visual";
} else {
$added="normal";
}
?>
<html>
<head>
<title>Visual example</title>
<link rel="stylesheet" type="text/css" href="<?=$added;?>.css" />
</head>
<body>
<a href="/anotherpage.php?site=<?=$added;?>">follow this link</a>
</body>
</html>
Nick
So, instead of using say ...font-size:10pt;....I'm using .....font-size:80%;
So if you alter text-size in your browser settings (view>text size in IE) the text increases, rather than this being over-ridden by your style sheet.
This assumes a visually impaired person would have text size set at larger or largest which is reasonable I suppose, and means you only need one style sheet.
Hope that's of some help.
PS: Kapow. If you do anything similar to my php example, make sure you sue JS links or forms to let the user change the site. If you don't you could fall seriously foul of duplicate content issues with Google and the rest of the gang...
Nick
<a href="some_page.htm?site=<? print $site ?>">some page</a>
and the style bit would be like this:
<link rel="stylesheet" type="text/css" href="<? print $site ?>.css" />
(I'm still new to php).
> JS links or forms to let the user change the site. If you don't you could fall seriously foul of duplicate content issues with Google and the rest of the gang.
Hmmm....
The site must work well on Google etc. I guess that means I need non JS links.
Can this be done???
With duplicate content issues does Google just decide which content to use and then ignore the other?
Secondly: If you want to maintain this state then the best way is sessions. Try looking in the manual, they have a very good explanation of how they work. Then either write a script to determine if the user is an SE and only start the session if it is not, or mail me as I've already done one.
Thirdly: JS links will not harm you. I'm just talking about the 'change site' links not all of them. So the SE's don't follow them and get dupicate content.
HTH!
Nick
Be careful with em and % sizes; it's very easy to make a mistake nesting tags and end up with microtext. This simple stylesheet:
div, ol, ul { font-size: .7em; }
...will cause real problems with this HTML:
<div>
<ol>
<li>This will be barely readable</li>
<ul>
<li>This will be microtext</li>
</ul>
</ol>
</div>
(This is a coding problem, not a compatibility problem.)
Sometimes, MSIE's leniency can lull you into a false sense of security. I use a third-party blogger which is really cool, but when I had it set to automatically add <p> tags it gave me real problems, but I never noticed. Someone sent me a screenshot of my Blog in Netscape 4, and the text in each paragraph was smaller than the last.
The blogger software was not closing the </p> tags. MSIE (I'd used it to check the blog was OK) had no problems: it closes the last paragraph when it finds a <p> tag. NS4 doesn't, and together with this stylesheet:
p { font-size: 75%; }
gave me microtext. The bits I'd checked in NS4 were the ones I'd coded by hand, and I'd closed all my <p> tags. I assumed the blogger was doing the same: a fatal error.
The best way to cater to the visually impaired is to write standards complient code (xhtml strict/1.1 being best)...
I think you may be mistaken. I'm not aware of any accessibility issues related to use of html/transitional instead of xhtml strict. I'm not aware of any relating to standards uncompliant code.
According to the Royal National Institute for the Blind (RNIB), the most popular browser amongst blind users is Internet Explorer 5.x (just like the rest of us :) ), with the Jaws screen reader.
Is there any evidence that standards compliant xhtml strict is more accessible than uncompliant html for current assistive technologies?
BTW: I'm a passionate accessibility advocate. I'm just really worried that folks increasingly assume that xhtml + css = accessibility.