What is the difference between Class and CSS id?

Asked

Viewed 4,029 times

-1

I’m starting in CSS and I saw these two properties that are similar and perform the same function, so somehow they must have some difference or other kind of function maybe,I wanted to know the difference between them (Class and id) or (. and #)

1 answer

3

Good evening, simply a class is a way to identify a group of elements like pro example class="button" whereas Id is a unique identifier for an element.

Elements in HTML can contain several example classes class="button btn-success" but only a single Id id="myButton".

  • saved me man, vlw !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.