开发者

Display DL like a table [duplicate]

开发者 https://www.devze.com 2023-01-08 11:46 出处:网络
This question already has answers here: How to style dt and dd so they are on the same line? (21 answers)
This question already has answers here: How to style dt and dd so they are on the same line? (21 answers) Closed 7 years ago.

How to style definition list items to have each definition in one line?

HTML:

<dl>
    <dt>word</dt><dd>meaning</dd>
    <dt>word<开发者_如何学C/dt><dd>meaning</dd>
    <dt>word</dt><dd>meaning</dd>
</dl>

Visual rendering I need:

*word* meaning
*word* meaning
*word* meaning


Try this.

dt  {
    clear:left;
    float:left;
    font-size:12px;
    line-height:26px;
    width:70px;
}

dd {
    clear:right;
    font-size:12px;
    line-height:18px;
    padding:4px 0 4px 40px;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消