spacing between paragraphs

windows

Guest
Hi, is there a tag that controls the spacing between paragraphs in a document ? Notice that I know how to control the spacing between the lines within a paragraph. Also, I know that <br> marks the ends a paragraph. In other words, can I control the amount of space between the end of a paragraph and the paragraph that follows it ?<br />
<br />
thanks<!--content-->How about this:<br />
<p style="margin-bottom: 15px;">Text here</p> <br />
Is this what you want?<br />
<br />
Best Wishes, <br />
David<!--content--><br> does not end a paragraph. It is a line break.<br />
<br />
Davidbrent has what you want, but if you use 'em' instead of 'px' the spacing will scale according to the size of the font you are using. It makes a difference when your page is viewed at different screen resolutions.<!--content-->Thank you David and Aronya, yes this is what I want. Can I specify this "margin-bottom" one time at the begining of the document for all paragraphs or I have to specify it in every paragraph as above ?<br />
<br />
Salam<!--content-->If you use CSS, you can designate it once as part of the properties for a paragraph's class. Then every paragraph you assign that class to will use that formatting.<!--content-->So I will still have to include something in every paragraph. In this case the class. That will work for me but I prefer to be able to tell the document once to use this bottom margin for all its paragraphs. I guess this is not possible.<br />
<br />
On the other hand, now I understand that <br> does not end a paragraph and thus a <br> can be inside a paragraph if it comes in a situation like this:<br />
<p> ... <br> .... <\p><br />
<br />
<br />
Thanks again,<br />
Salam<!--content-->Hello Salam, <br />
<br />
The simple answer to your question is yes. Like Aronya1 said, you will need to know a little CSS. Here is how you could do it:<br />
<br />
Put this in between your <head></head> tags<br />
<br />
<style type="text/css" media="all"><br />
<!--<br />
.new {<br />
margin-bottom: 15px<br />
}<br />
--><br />
</style><br />
<br />
<br />
Put this in you <body><br />
<br />
<p class="new">Text goes here</p><br />
<br />
<br />
I hope this helps. <br />
<br />
Best Wishes, <br />
David<br />
<br />
PS: I reccomend you learn CSS.<!--content-->Sorry i posted before your last reply. <br />
Originally posted by Salam <br />
but I prefer to be able to tell the document once to use this bottom margin for all its paragraphs. <br />
Yes this is possible. I would not reccomend it however unless you are prepared to define every paragraph that you don't want the bottom margin to be XXpx. <br />
<br />
Here is how you do it.<br />
<br />
<br />
<style type="text/css" media="all"><br />
<br />
p { margin-bottom: 15px; }<br />
<br />
</style><br />
<br />
<br />
and in your html, simply,<br />
<br />
<br />
<p>text text text </p><br />
<br />
<br />
<br />
I think this is right!<br />
<br />
Best Wishes, <br />
David<!--content-->Thank you very much David and Aronya :)<br />
<br />
Salam<!--content-->YAW<!--content-->No problem ;)<!--content-->David's second post is the right way to go. If there are different parts of your page where you want different paragraph behaviours then they can be handled using divs or other structural separating means. Eg:<br />
<br />
#oneplace p { margin: 0 0 1.5em 0; }<br />
<br />
#twoplace p { margin: 1em; }<br />
<br />
and in the HTML:<br />
<br />
<div id="oneplace"><br />
<p>These paragraphs have the extra bottom margin</p><br />
<p>See how it works?</p><br />
</div><br />
<br />
<div id="twoplace"><br />
<p>These paragraphs have margins all around.</p><br />
<p>See how it works?</p><br />
</div><br />
<br />
Doing it this way keeps your HTML cleaner and avoids what Zeldman calls "classitis".<!--content-->I stand corrected. That's a better way to go.<!--content-->Ah i see. I was specifying mine so someone could have multiple divs with same classes. I chose this over id's as i know the validators wouldn't like it. <br />
<br />
But yea, Ray yourpost is just what he needs. <br />
<br />
Best Wishes, <br />
David<!--content-->
 
Back
Top