The Difference Between ID and Class in CSS
The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
The benefit of this is that you can have the same HTML element, but presented it differently depends upon its class and id properties.
HTML elements can have both class and Id selectors.
<div class = "box" id = "header">
.............
.............
</div>
In the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”).
Is there any problem to have same id to multiple html tags.
ReplyDelete