Previous Message
Next Message

Re: [css-d] Styling a DL

Sent by John Lewis on 29 May 2003 03:03


winters wrote on Wednesday, May 28, 2003 at 8:32:39 PM:

> I have a list of terms with definitions. I want the term to be
> underlined followed by a dash and then the definition:

> term - bla bal this means that you are
> term - bla bal this means that you are
> term - bla bal this means that you are

This is hard to do theoretically, much less in practice. At first I
thought of this:

    dt{display:run-in;text-decoration:underline}
    dt:after{content:"\00a0\2014\00a0"}

But that would underline the dash and spaces as well. So then I
thought of this:

    dt{display:run-in;text-decoration:underline}
    dd:before{content:"\00a0\2014\00a0"}

Which works, but isn't ideal if there's more than one definition:

    Term one - Definition one
     - Definition two
    Term two - Definition

That's about the best I could do.

I can't think of a practical way to do what you want. You could try
fooling around with floats or positioning.

> I tried dl { display: inline; } and dd { display: inline; } and dt
> {display: inline; } and different conbinations of those. None worked
> for me.

If either the dd or dt elements are block, they won't be on the same
line. If they're both inline, all of the dt and dd elements will be on
the same line. For example:

    Term one Definition one Definition two Term two Definition

-- 
John Lewis

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: