Is it necessary to have selector's name in same case in css and html?
is it ok ?
<div id="HEADER"> </div>
#header{...}
or this is necessary?
<div id="HEADER"> </div>
#HEADER{...}
Is it necessary to have selector's name in same case in css and html?
is it ok ?
<div id="HEADER"> </div>
#header{...}
or this is necessary?
<div id="HEADER"> </div>
#HEADER{...}
Class names and IDs are case sensitive, so they must have the same casing.
Therefore, div.MyClass
is not the same as div.myClass
.
Element (in HTML) and pseudo-class (everywhere) names are not case sensitive, so DIV:hover
is the same as div:HOVER
.
For more information, read the spec.
Your second example should be #HEADER{...} but the answer is... some browsers are case sensitive if you use an XHTML doctype. See here: http://webdesign.about.com/od/css/f/blcssfaqcase.htm