If we use an attribute selector to select an element by its ID then it will have a lower level of specificity than if it was selected with an ID selector. 

For e.g. We can target the same element with [id="ID_name"] and #ID_name but with lower specificity.

HTML


<div id="ID_name">...</div> 

CSS


#ID_name { ... } /* High specificity */

[id="ID_name"] { ... } /* Low specificity */

0 Comments

Leave a reply

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