Thanks for telling me that. I guess that using classes is alright and I wold rather avoid using ids. Because I thought that two ids can be used at the same page.
Id's may only be used once for every element in the document. Class attributes can be used on many elements so that css can put the same style on many elements. But javascript can only get elements by their id (and others), not class.
-gs
If you use id in your tag (like <div> or <p> etc) you use in the .css file #menu, #main etc
When using class you use .menu .main etc
That is one basic difference. Class can be used multiple times on a page. I never tried id to use it for - it may be true as the others say that it is only once to be use for an element.
How I still used id is the way with javasrcipt pointing to a an id - this javascript can read for sure. (I don't know about it's functionality with classes)
If you use javascrip to be used together with styling use id, use class otherwise - as for my view.
That has also helped me out a lot, I used to get confused with this issue a lot myself but the last few posts have helped to clear things up for me a lot.
Anyone have any clever tips for remembering the way to call classes and id's?
As I understand it id's are called using #content etc,
classes are called using .class
Is this correct?
Also am I right in thinking in summary then that classes can be applied to multiple attributes and id's can be used only once on a page?