By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

Blank line after a definition list (DL)?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
..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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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.