Class– A class is a style (like a group of CSS attributes) that can be applied to one or more HTML elements. It is applied to an HTML element via the class attribute and the class name.

.example-class: {background: #000;}

ID– A ID selector is a name assigned to a specific style. It can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name.

#example-id: {background: #000;}

About Raka Rocks

Hi, My self Raka Rocks. I am web designer and Front End Developer total 8 year exp. in this fields. I am a continuous blogger and has blogged on different topics. He loves to surf the Internet and always tries to get new ideas about new technologies and innovations and share this excellent information with all technology lovers.

2 thoughts on “What is a class? What is an ID?

Leave a Reply

Your email address will not be published.