Re: Upper case selectors

R.S.V. wrote:
> A user, who visited a web that I designed, had sent an email to
> me, he says that my CSS code have an accessibility problem.
> My code is XTML 1.0 valid, and CSS valid. In the CSS, I have
> selectors like “DIV.uno”. He sent the follow paragraph of XHTML
> specification:

Whether or not this is accessible depends on how strict the user agent 
is at enforcing rules.  If you are using XHTML which is being validated 
against the DTD, all elements (tags) must be in lower case.  In an XML 
environment, the CSS should match what is in the XML, therfore your DIV 
(upper case) should be div (lower case).

If the user agent uses a validating XML parser, you may find that the 
stylesheet throws an error.  As Bill Mason points out, for 
accessibility, the page should work without stylesheets anyway.

I think that the sensible thing to do is simply to write everything in 
lower case.  You can use the Perl function lc() in combination with an 
XML or HTML parser to convert your files if there is too much to do 
manually.

Cheers

M

-- 
Matthew Smith
Kadina Business Consultancy
South Australia
http://www.kbc.net.au

Received on Friday, 24 October 2003 07:02:48 UTC