homepage Welcome to WebmasterWorld Guest from 54.227.77.237
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Accessibility and Usability
Forum Library, Charter, Moderators: ergophobe

Accessibility and Usability Forum

    
Accessible and valid CSS
w3c css colours and website accessibility conflict?
essjay2002




msg:3108271
 3:34 pm on Oct 4, 2006 (gmt 0)

Ok, I'm getting confused and might have missed something so would be grateful if there's anyone out there who can clear this up for me!..
Ok, so to create valid CSS, the W3C css validator wants you to set background-color whenever you specify a foreground color. BUT I'm finding that if i do this, perversely the user cannot make any changes to those page colours using the accessibility tools in Internet Explorer.
Try it with Internet Explorer (v6) go to tools, internet options, accessibility and choose to "ignore colours specified on web pages", then set your colours to green text on a black background for example (you also do this in the internet options window).
Now view a webpage where divs have their foreground and background colours specified in the CSS and see what happens.

Can anyone clear this up? Is it another case of w3c recommendations rendering a web page inaccessible?

 

icantthinkofone




msg:3108304
 3:50 pm on Oct 4, 2006 (gmt 0)

What you are talking about is accessability and not validation. Your site can validate but still not be considered accessible. The colors thing is a warning and not an error. And if IE does not allow you to change the colors, then that is IEs problem and not the standard.

penders




msg:3108334
 4:19 pm on Oct 4, 2006 (gmt 0)

...Now view a webpage where divs have their foreground and background colours specified in the CSS and see what happens.

In the few tests I've done, setting "ignore colours specified on web pages" (in IE6) - it does indeed ignore the colours, including inline styles and out-dated BGCOLOR tags?! Is it possible that the 'colour' you see is actually a background image?

bedlam




msg:3108346
 4:26 pm on Oct 4, 2006 (gmt 0)

Is it another case of w3c recommendations rendering a web page inaccessible?

No.

You have to think about why the validator warns you about the lack of an explicitly set color/background-color combination; the eventuality it's encouraging you to guard against is a situation where you have defined one of either the color or background-color in a given color, and a visitor's custom stylesheet defines the other in the same color.

Provided your CSS and markup are reasonably accessible to begin with, it should usually be no great problem if the user cannot override your settings.

However, though IE6 is surely a mess in this as in many other areas, I can't verify your claim that when background-color and color are explicitly set, "the user cannot make any changes to those page colours using the accessibility tools in Internet Explorer." For example, IE renders the following page in black and white when the "Ignore colors specified on Web pages" box is checked (though on the other hand, I notice IE can't seem to turn off the italic and bold styles when the "Ignore font styles specified on Web pages" box is checked):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IE Accessibility Settings Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#foo {
background:#090;
color:#900;
padding:1em;
font-weight:bold;
}
</style>
</head>

<body>
<div id="foo" style="font-style:italic;background-color:#f00;">
<p>Sed eget urna at tortor scelerisque placerat. Ut non tortor non urna lacinia dapibus. Sed dignissim hendrerit ante. Pellentesque placerat ante a turpis. Vivamus consectetuer eleifend eros. Sed vehicula mauris nec quam. Sed sodales ullamcorper lacus. Suspendisse potenti. Suspendisse libero massa, egestas in, iaculis ac, adipiscing ac, enim. Vestibulum tempus sodales lacus. Fusce aliquet pretium dolor. Morbi sagittis quam sit amet tellus. Vivamus purus. Integer felis nisi, molestie et, auctor id, mollis et, nisi. </p>
</div>
</body>
</html>

-b

jessejump




msg:3110434
 1:46 am on Oct 6, 2006 (gmt 0)

>>>>> a situation where you have defined one of either the color or background-color in a given color, and a visitor's custom stylesheet defines the other in the same color.

I've never understood this reasoning.
Why would a user who needs to set colors for readability only set one of those two styles?
Are you saying a user may set the text color to be yellow, for example, on every web page - and not set the bg color of his choice?

bedlam




msg:3115650
 4:47 pm on Oct 10, 2006 (gmt 0)

I've never understood this reasoning.
Why would a user who needs to set colors for readability only set one of those two styles?
Are you saying a user may set the text color to be yellow, for example, on every web page - and not set the bg color of his choice?

It's not very difficult to figure out; a user may want or need a stylesheet more sophisticated than this:

* { background:#fff; color:#000; }

...which, since the user will not know every possible selector in every site s/he visites, is the only way to accomplish what you're suggesting.

-b

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Accessibility and Usability
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved