Forum Moderators: not2easy

Message Too Old, No Replies

Setting Width Property to Lists

Trying to set up a schedule

         

nofx1728

4:26 pm on Apr 16, 2007 (gmt 0)

10+ Year Member



Hi. I'm trying to set up a schedule that includes:

1. Date
2. Location
3. Info

I have it set up as


<dl>
<dt>Date</dt>
<dd>Location</dd>
<dd>Info</dd>
</dl>

My width in my div is 522px. I would like each part of my list to be 174px; (dt, dd, dd) I tried setting it up with dt {width:174px; display: inline;} dd {width: 174px; display:inline} but the width is not being recognized. Is this possible?

Thanks,

nofx1728

JAB Creations

4:45 pm on Apr 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Inline and floating block-level elements only have minimal width. You would need to set your elements to block-level elements or use block-level elements to achieve a set width.

- John

SuzyUK

10:55 am on Apr 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it's possible, and JAB's right, an inline element cannot accept the width parameter,
but just to clarify you *should* float them instead of using display: inline; ;)

floated elements automatically become block-level elements and will accept your width as well as displaying side by side, you might then need some clearing of floats but it depends on your background, let us know how you get on

Suzy