What is the advantage of an ID over simply giving something an ID??

My explanation for the existance of IDs in CSS is simply that if IDs are there to be used in HTML, then they need to be there in CSS too.


In other words, if you're sitting there with your own HTML document and you're wondering what's the difference between using an ID and a class to style one particular <H1> element, there really isn't one.

But if you're in control only of the CSS document, trying to style a page created by someone else, or otherwise beyond your control, and they've used IDs for whatever reason, the CSS syntax allows you to do that too.
------------------------------------------------------------
"Have You Validated Your Code?"
John Horner (+612 / 02) 9333 3488
Senior Developer, ABC Online http://www.abc.net.au/
------------------------------------------------------------


******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to