css selectors - What #id.class css means? -


this question has answer here:

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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -