我試圖選擇類「subnav」的第一個行項目(<li>
)。選擇嵌套元素的第一個子項時遇到問題
我似乎無法得到它:
HTML:
<nav>
<ul class="navigation">
<li class="logo"><ul>
<li><a href="index.htm"><img src="images/rh_logo_v5.png" alt="roundhaus logo"/></a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="index.htm">home</a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="reclaimedwood.htm">reclaimed wood</a></li>
<li><a href="design.htm">design</a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="flooring.htm">flooring</a></li>
<li><a href="paneling.htm">paneling</a></li>
<li><a href="beams.htm">beams</a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="shelving.htm">shelving</a>
</li><li><a href="mantels.htm">mantels</a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="news.htm">news</a></li>
</ul></li>
<li class="subnav"><ul>
<li><a href="woodtypes.htm">wood types</a></li>
<li><a href="phrases.htm">phrases</a></li>
</ul></li>
</ul>
</nav>
會是什麼CSS選擇器是與類「subnav」行項目的第一個實例?
'li'代表*列表*項目,而非*行*項目:) – BoltClock 2012-03-25 14:47:13
您想要選擇