css selectors - What #id.class css means? -
this question has answer here:
- how combine class , id in css selector? 9 answers
i saw in css declaration this:
#nav.js { display:none; }
can explain means? html code following
<ul id="nav"> <li><a href="#">home3</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul>
#nav.js
this selects element id
set "nav"
, has class
containing "js"
.
for example, select of following elements:
<figure id="nav" class="js"></figure> <figure id="nav" class="foo js"></figure> <figure id="nav" class="js bar"></figure> <figure id="nav" class="foo js bar"></figure>
but wouldn't select of these elements:
<figure></figure> <figure id="nav"></figure> <figure class="js"></figure> <figure id="nav" class="foo bar"></figure>
display: none
this i'm sure you're aware sets element not display @ on page.
#nav.js { display: none; }
this combines above. selects element id
of "nav"
, class
containing "js"
, sets not display on page.
Comments
Post a Comment