Home › Forums › CSS › [Solved] what's difference between these selectors ? › Reply To: what's difference between these selectors ?
October 22, 2013 at 5:28 am
#153683
Paulie_D
Member
#selector
or .selector
will usually be enough.
There should never be a need for tagName#selector
(eg. div#header
) because the #
is an ID and should be unique on the page.
You might occasionally see div.selector
but this usually only where the class is quite general and could be applied to multiple element types.
So div.selector
would apply only to divs with that class but .selector
would apply to ANY element with that class whether is was a div or not.