是否可以通过CSS单独从此HTML块中选择以下内容?或者选择我想要选择的所有内容?
<dl>
<dt>dt one</dt>
<dd>dd one A</dt>
<dt>dt two</dt>
<dd>choose this dd and only this dd</dd>
<dd>dd two B</dd>
<dt>dt three</dt>
<dd>dd three A</dd>
</dl>
答案 0 :(得分:2)
dd:nth-child(4)
或dd:nth-of-type(2)
之类的声音会为您提供该元素,除非您的问题中没有提到所有的条件(它在其中看起来很简单)目前的形式)。
答案 1 :(得分:0)
是。 W3Schools有一个很好的资源:http://www.w3schools.com/cssref/css_selectors.asp
您可能会发现特别感兴趣的第n个子选择器。