469,317 Members | 1,966 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

Blank line after a definition list (DL)?

Is there a way I can have the browser automatically insert a blank
line after each definition in a definition list? Right now I have
this:

term-1
definition text ....
term -2
definition text ...

I'd like to have this:

term-1
definition text ....

term -2
definition text ...
But I want to do it without manually putting a blank line after each
"definition text".
Mar 2 '08 #1
6 4354
..oO(Timur Tabi)
>Is there a way I can have the browser automatically insert a blank
line after each definition in a definition list?
Sure. Use CSS to adjust the bottom margin of the 'dd' elements:

dd {margin-bottom: 1em}

Micha
Mar 2 '08 #2
On 2008-03-02, Timur Tabi <ti***@tabi.orgwrote:
Is there a way I can have the browser automatically insert a blank
line after each definition in a definition list? Right now I have
this:

term-1
definition text ....
term -2
definition text ...

I'd like to have this:

term-1
definition text ....

term -2
definition text ...
But I want to do it without manually putting a blank line after each
"definition text".
dl { margin-bottom: 2.24em }
Mar 2 '08 #3
On 2008-03-02, Michael Fesser <ne*****@gmx.dewrote:
.oO(Timur Tabi)
>>Is there a way I can have the browser automatically insert a blank
line after each definition in a definition list?

Sure. Use CSS to adjust the bottom margin of the 'dd' elements:

dd {margin-bottom: 1em}
Oops, yes that's what I meant when I just said to put a margin-bottom on
the dl.

You could use margin-bottom: 1.12em since that's normally what's used in
browser default stylesheets to approximate the height of one line. It
doesn't make much difference though.
Mar 2 '08 #4
On 3/2/2008 12:44 PM, Timur Tabi wrote:
Is there a way I can have the browser automatically insert a blank
line after each definition in a definition list? Right now I have
this:

term-1
definition text ....
term -2
definition text ...

I'd like to have this:

term-1
definition text ....

term -2
definition text ...
But I want to do it without manually putting a blank line after each
"definition text".
I prefer to specify margins at the top, not only for Web pages but also
when using Word.

<style TYPE="text/css">
dt { margin-top: 1em }
dd { margin-top: 0.5em }
</style>

This puts a one-em blank line before the defined term (the dt) and only
a half-em line between the defined term and the definition itself (dd).

--
David Ross
<http://www.rossde.com/>

Have you been using Netscape and now feel abandoned by AOL?
Then use SeaMonkey. Go to <http://www.seamonkey-project.org/>.
Mar 2 '08 #5
Scripsit Ben C:
You could use margin-bottom: 1.12em since that's normally what's used
in browser default stylesheets to approximate the height of one line.
It doesn't make much difference though.
And you don't need to make guesses on the line height, because you can
set it (it's healthy anyway; the specific value should depend on the
font characteristics):

* { line-height: 1.12; }
dd { margin-bottom: 1.12em; }

A full blank line might be a little too much, though.

Anyway, this is purely a CSS matter. It would not make sense to try to
force empty vertical spacing using HTML markup, especially since it's so
simple in CSS.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 2 '08 #6
"Jukka K. Korpela" <jk******@cs.tut.fiwrites:
And you don't need to make guesses on the line height, because you can
set it (it's healthy anyway; the specific value should depend on the
font characteristics):
The specific value should depend on several factors, language not the
least of them (erm, I know that you know that, but you don’t say that
above, and normal people never consider that ;-).
A full blank line might be a little too much, though.
I wonder why the idea of a baseline grid is so alien to web
typography. But I don't even know if I disagree. :-)

--
“Rapidiously develop corporate value rather than installed base process
improvements. Collaboratively unleash process-centric synergy with
interoperable best practices.”
<http://www.apple.com/downloads/dashboard/developer/corporateipsum.html>
Mar 3 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Neil Zanella | last post: by
28 posts views Thread by Atanas Boev | last post: by
9 posts views Thread by Dave H | last post: by
22 posts views Thread by Firas | last post: by
10 posts views Thread by matt_randle | last post: by
11 posts views Thread by David | last post: by
6 posts views Thread by James A. Donald | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.