Special welcome gift. Get 50% off your first courses with code “AS50”. Find out more!

HomeCoachingInterviewCSS Q/AWhat is the Difference between id and class?
course 6

What is the Difference between id and class?

Answer:

The id and class is being used in HTML and includes the values from CSS. The difference is as follows:

1. Id is an attribute that it uniquely assigns a name to a particular element, whereas class defines an element with certain set of properties which can be used for a complete block.
2. Id can be used for an element and uniquely identifies it, whereas class is used as block element and applied to many tags where it is used.
3. Id restricts the use of properties to one specific element, whereas class applies the rules and properties to specific block or group of elements.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

Categories

ads sidebar 1

You May Also Like

It’s about making websites work wherever the web is. Different devices with different sizes and different capabilities. Responsive design is...
It’s an alternative to graceful degradation, which concentrates on the matter of the web. The functionality is same, but it...