I thought that I understand id’s vs classes in css documents. As far as I know there should be only one instance of id element in html document and many class elements. Now I’m looking on Microsoft driven Site.css template which is generated on every new mvc3 project and I see that there is .page element not #page ? Am I missing something here ?
Share
Developers generally use
#idif they are looking for applying some javascript to that element, and ID should be unique, where as.whateveris a class which you can use it multiple times..As you said
Microsoft may be using
.pagebecause it must be applying to multiple things, so it’s simply not using#page, it doesn’t really make a difference, ya but as far as the specifity goes,#idselector has higher precedence than.class