Salesqueen Software Solution

Download Free Estimation Now Click Here
Notifications
Clear all

What is the difference between IDs and Classes?

3 Posts
3 Users
0 Reactions
127 Views
Posts: 150
Topic starter
(@dinesh)
Estimable Member
Joined: 2 years ago

IDs and Classes

2 Replies
Posts: 461
(@dinesha-g)
Reputable Member
Joined: 2 years ago

An ID is different from a class in that it can only be used to identify a particular element in our HTML. IDs are only employed when a specific style should be applied to a single element on the page. However, more than one HTML element can be identified using a class.

Reply
Posts: 100
 Kavi
(@kavi)
Estimable Member
Joined: 2 years ago

Classes

A class can be applied to different elements, allowing it to appear many times on a single page. The class name begins with "." and is followed by the name of the class when it is applied to an element. A single element can have many class selectors attached to it.

ID

The Id is exclusive to a page and can only be applied to one particular element. The "#" sign precedes the Id name, which is then a name that is specific to that Id. An element can only have one ID selector attached to it.

Reply
Share: