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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top