css - HTML li class=youarehere not working -


am doing html website, , have main menu - home, etc.
have several html pages , each page want menu li change color #e38400.

here code:

<div id="nav">     <ul>         <li class="youarehere"><a href="#"><h3>menuitem</h3></a></li>         <li><a href="#"><h3>menuitem</h3></a></li>         <li><a href="#"><h3>menuitem</h3></a></li>         <li><a href="#"><h3>menuitem</h3></a></li>         <li><a href="#"><h3>menuitem</h3></a></li>     </ul> </div> 

and style.css code:

.header #nav ul li .youarehere {     background:#e38400; border-radius:5px; color:#fff;     } 

but first list item still shows same color etc. want use neither jquery nor other script, why not working?

you need remove li or place .youarehere li without space :

.header #nav ul li.youarehere {   background:#e38400;    border-radius:5px;    color:#fff;  } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -