Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

P Line Height

Status
Not open for further replies.

kafmil

Technical User
Jul 15, 2002
71
AU
How do you change the distance in between paragraphs seperated by <p> tags? Line-height only controls distance between lines inside a <p></p> tag.
 

kafmil,

Depending on where you want the padding, you can set either padding-bottom or margin-bottom:

Code:
P { margin-bottom: 20px; }

or

Code:
P { padding-bottom: 20px; }

Hope this helps

Dan
 
I have tried both of these methods but i cannot get the distance to be smaller. If i make them both 20 the distance increases, but i currently have them set as follows.

p
{
margin-bottom: 1px;
padding-bottom: 1px
}

And the distance is the same as if i don't have it set at all. Is there a way to reduce the distance?
 
You might like to try the TOP and the BOTTOM margins... by default I think they are set to something like 20px top and bottom:
Code:
p {
	margin-top: 20px;
	margin-bottom: 20px;
}

Therefore you may have to reduce both of them to get the desired results.

NOTE: If you simply use:
Code:
p {
	margin:10px;
}
... then you'll get an indent from the left and right margins of the controlling element (eg, the page/document).

Pete.




Lotus Notes Web Developer / Aptrix (LWWCM) Consultant
w: e: Pete.Raleigh(at)lclimited.co.uk
 
If you want to remove all the spacing inbetween paragraphs, use:

Code:
p { margin: 0px; }

Here's an example showing this at work:

Code:
<HTML>
<HEAD>
<STYLE TYPE=&quot;text/css&quot;>
p { margin: 0px; }
</STYLE>
</HEAD>
<BODY>

<P>This is paragraph 1</P>
<P>This is paragraph 2</P>
<P>This is paragraph 3</P>

</BODY>
</HTML>

Hope this helps!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top