12

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

HTML:

<dl>
    <dt>word</dt><dd>meaning</dd>
    <dt>word</dt><dd>meaning</dd>
    <dt>word</dt><dd>meaning</dd>
</dl>

Visual rendering I need:

*word* meaning
*word* meaning
*word* meaning
takeshin
  • 49,108
  • 32
  • 120
  • 164
  • See http://stackoverflow.com/questions/1713048/how-to-style-dt-and-dd-so-they-are-on-the-same-line/24520786#24520786 – Justin Jul 01 '14 at 23:43
  • Answered in the 'duplicate' question - comparising
    to http://stackoverflow.com/a/32727905/4258817
    – Mousey Sep 22 '15 at 22:22

1 Answers1

8

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;
}
gearsdigital
  • 13,915
  • 6
  • 44
  • 73