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

horizontal line

P: n/a
Hi!
How is it possible to reduce the space between a pargraph and a horizontal
line (top and bottom). It doesn´t look so good if there is the default
space.

Thanks
Bernd
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Bernd Kuegle" <of****@nowhere.com> wrote:
Hi!
How is it possible to reduce the space between a pargraph and a horizontal
line (top and bottom). It doesn´t look so good if there is the default
space.

Thanks
Bernd


A horizontal rule (<hr>) doesn't default to have any spacing, it's the
paragraphs themselves that create the spacing.

p { margin: 4px; }

The above CSS would set the margin on paragraphs to 4 pixels,
hopefully you can change this to suit your needs.

Dave
Jul 20 '05 #2

P: n/a
"Dave" <da**************@gmail.com> schrieb im Newsbeitrag
news:49**************************@posting.google.c om...
"Bernd Kuegle" <of****@nowhere.com> wrote:
Hi!
How is it possible to reduce the space between a pargraph and a horizontal line (top and bottom). It doesn´t look so good if there is the default
space.

Thanks
Bernd


A horizontal rule (<hr>) doesn't default to have any spacing, it's the
paragraphs themselves that create the spacing.

p { margin: 4px; }

The above CSS would set the margin on paragraphs to 4 pixels,
hopefully you can change this to suit your needs.

Dave


Great! That works!
Thanks
Bernd
Jul 20 '05 #3

P: n/a
da**************@gmail.com (Dave) wrote:
How is it possible to reduce the space between a pargraph and a horizontal
line (top and bottom). It doesn´t look so good if there is the default
space.


A horizontal rule (<hr>) doesn't default to have any spacing


The correct phrase is margins. And a hr does have default margins in all
UAs I know.

For the OP: first consider not messing with the default margins, they
are there for a reason.

Note that once you start messing with default margins you can easily get
into a quagmire and you could end up with having to specify margins far
more often than you should.

If you absolutely must you may need to set margins on both the
paragraph and the hr, read up on the phenomena of collapsing margins
first. Note that a common problem is that IE does not allow the margins
on hr's to be set below a certain value.

--
Spartanicus
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.