【发布时间】:2010-12-15 08:15:53
【问题描述】:
使用 CSS,我如何设置以下样式:
<dl>
<dt>Mercury</dt>
<dd>Mercury (0.4 AU from the Sun) is the closest planet to the Sun and the smallest planet.</dd>
<dt>Venus</dt>
<dd>Venus (0.7 AU) is close in size to Earth, (0.815 Earth masses) and like Earth, has a thick silicate mantle around an iron core.</dd>
<dt>Earth</dt>
<dd>Earth (1 AU) is the largest and densest of the inner planets, the only one known to have current geological activity.</dd>
</dl>
所以dt 的内容在一列中显示,dd 的内容在另一列中,每个dt 和对应的dd 在同一行? IE。产生的东西看起来像:
【问题讨论】:
-
作为一个有用的说明:如果你想控制 dts 和 dds 行之间的间距,请检查:stackoverflow.com/q/896815/114029 这些强大的标签使样式表单变得非常简单和美观。
-
请考虑将接受的答案更改为:stackoverflow.com/a/44599527/3853934