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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make the space BR and/or P tags create smaller 1

Status
Not open for further replies.

HardCoreCoder

Programmer
Feb 13, 2008
11
0
0
US
Is there a way to make the space that a <BR> or <P> tag create smaller.

For example. I have 2 paragraphs of size 12pt text. I put two <BR>'s to split the text. My boss wants the gap between the text smaller.

Is there a way to do this? I don't mind not using <BR> or <P> if there is something else I can do to make the gap smaller. Maybe put a DIV tag with a specified height between the two paragraphs?
 
You can just set the padding between the two paragraphs to be whatever size you want. e.g.
Code:
<p style="padding-bottom:2em;">Paragraph 1</p>
<p>Paragraph 2</p>
Make sure you've reset all of the paddings and margins on all elements first as well as some browsers will automatically add different paddings to others e.g.
Code:
* {padding:0;margin:0;}


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Thanks for the reply.

I tried what you said and I can add MORE to it but it does not seem to allow me to reduce it. The following code is what I used, I get the standard spacing between paragraphs.

Code:
							<p style="padding-bottom:1pt;"><font face="Arial" size="2">Come live out your 
							Disney Dreams as <strong><i>The Year of a Million Dreams</i></strong> 
							celebration continues through 2008. It&#8217;s 
							more affordable than you think! A family of four can 
							enjoy a 6-night/7-day vacation with accommodations 
							and park tickets starting at $1,600.</p>
							
							<p style="padding-bottom:1pt;"><font face="Arial" size="2">Or discover a 
							different kind of Disney magic with a 3-, 4- or 
							7-night Disney Cruise vacation or a 7-night land and 
							sea package that combines a cruise with a stay at 
							the parks. </font></p>
 
To add some learning to those posts, paragraphs have default margins, that is gaps between them. If you use CSS to alter that margin, you can achieve smaller (or larger) gaps. If you work with padding, it won't work because I think most browsers use margin to create the gap.

I would advise against using the <br /> tag. It is not meant to be used as a gap between paragraphs.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top