html - Css <ul> selector -
what selector reach ul markups highlighted below? (no class or id possible need selector html markup)
here html code:
<div id="mainmenu"> <ul class="menu"> <li class="item-472"> <a href="#">accueil</a> </li> <li class="item-475 current active deeper parent"> <a href="#" class="drop">produits</a> **<ul> <!--here first ul i'm tryin style --> ** <li class="item-519 deeper parent" > <h3>fenĂȘtres</h3> <p>pvc</p> <a href="#">fenĂȘtres</a> ** <ul> <!-- sec ul style -->** <li class="item-521 deeper parent"> <a href="#">pvc</a> <ul > <li class="item-522"><a href="#">arcade</a></li> </ul> </li> </ul> </li> </ul> </li>
there number of ways style these unordered lists, depending on how specific want selectors be. have created comprehensive list below.
ways select first ul
:
ul
li ul
ul li ul
ul .item-475 ul
ul .current ul
ul .active ul
ul .deeper ul
ul .parent ul
ways select sec ul
:
ul ul
li ul ul
ul li ul ul
ul .item-475 ul ul
ul .current ul ul
ul .active ul ul
ul .deeper ul ul
ul .parent ul ul
important: sure sec ul
either specific or more specific first ul
. otherwise, style of first ul
applied sec ul
.
for example, this work:
li ul { /* styles here */ } ul .current ul ul { /* styles here */ }
but this not work:
ul .current ul { /* styles here */ } ul ul { /* styles here */ }
html css css-selectors
No comments:
Post a Comment