469,903 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

horizontal line

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
3 6168
"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
"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
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.

Similar topics

1 post views Thread by Peter Mount | last post: by
2 posts views Thread by Steve Teeples | last post: by
1 post views Thread by Marco Liedekerken | last post: by
2 posts views Thread by Tina | last post: by
4 posts views Thread by Sakharam Phapale | last post: by
2 posts views Thread by Csaba Gabor | last post: by
2 posts views Thread by laredotornado | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.