PDA

View Full Version : Definition Lists - Formatting and Headings



s4shawn
Feb 13th, 2003, 04:18 PM
I was wondering if there is an easy way (CSS) to position a DD next to a DT in a DL, rather than the way most browsers put the DD on the next line.

Also, I stumbled across this link:
http://www.w3.org/MarkUp/html3/deflists.html

What is the "proper" way to markup a heading for a list, esp. since it seems LH did not make it to HTML 4.0?

meow
Feb 13th, 2003, 04:56 PM
Only thing I can think of is to float them. You need to limit the space they live in so no DDs 'float up'.

Something like so:

dt, dd { float: left; margin: 0; margin-top: .5em; padding: 0 }
dt { width: 10em; clear: both }
dd { width: 25em }

dl { width: 40em }



<dl>
<dt>Books</dt>
<dd>are fun to read yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda yadda</dd>
<dt>Dusting</dt>
<dd>is no fun though</dd>
</dl>
</div>

It should also work to make DT and DD say 20% - 79% if you want them to span the whole page. I think. :rolleyes: