CSS和定义列表 - 选择特定的定义描述

时间:2012-11-12 02:06:50

标签: html css css-selectors

是否可以通过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>

2 个答案:

答案 0 :(得分:2)

dd:nth-child(4)dd:nth-of-type(2)之类的声音会为您提供该元素,除非您的问题中没有提到所有的条件(它在其中看起来很简单)目前的形式)。

答案 1 :(得分:0)

是。 W3Schools有一个很好的资源:http://www.w3schools.com/cssref/css_selectors.asp

您可能会发现特别感兴趣的第n个子选择器。