CSS question: id == class?

P

Peter Flynn

Xah said:
In CSS, what's the difference between "id=" and "class="?

i thought id is CSS2 version equivalent for a shorter name. But
apparently if i replace class with id on a webpage they don't work...
thanks.

ID values must be unique per document. They identify a single object.
That's why they're called "IDs".

Class values can occur arbitrarily.

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top