Whilst it won't affect accessibility or usability for the end user
(afaik) the class and id names should have semantic meaning indicating
there logical function - rather than id="rightColumn" you might use
id="localNavColumn" if the function of the column was to contain local
nav. This means if the column changes to the left hand side there is
still a logic to the naming. It also helps clarify the division of the
page in your own mind.
There were some problems in earlier browsers with the underscore in
class names and ids so I tend to camelCase.
As for the directory links, I think it might be more to do with the way
the CMS is configured to produce clean URLs rather than any accessiblity
issue. This increases the likliehood of Google indexing all of your
pages (as opposed to get strings in the urls such as
www.example.com?q=22). These are normally handled via server side
rewrites of the url string.
HTH
James
James Oppenheim wrote:
Hi all,
Does anyone know of a set of naming conventions for css classes and
ids? Should they have semantic meaning? I.E. “address” rather than
“bottom”.
How should you go about naming the “right column” div.
<div id=”right-col”></div>
<div id=”right_col”></div>
<div id=”right-column”></div>
<div id=”right_column”></div>
<div id=”rightcol”></div>
<div id=”rightcolumn”></div>
<div id=”right”></div>
What about for file names.
naming_conventions.html
naming-conventions.html
namingconventions.html
namingConventions.html
conventions.html
I tend to use underscore for class and id, try very much to stay away
from two word file names.
Also, I have noticed that many people use directories and the index of
each rather than file names. I.E.
http://www.companyname.com.au/stuff/conventions
Is this for accessibility?
Sorry about the question of three parts, but what do guys you think?
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************