View Full Version : spacing between 2 parahs
rjain
06-24-2005, 03:28 PM
Hi,
Would anyone know how to give 1 1/2 space between 2 para in html or using CSS ? I would like to give space a little more than using <br> and less than using<p> for next para.
Thanks,
p {
padding-bottom: 1.5em;
}
No problem :p
If 1.5em isn't exactly what you want, experiment.
mwinter
06-24-2005, 04:05 PM
p {
padding-bottom: 1.5em;
}Setting the margin property would be better, not least because it will be necessary to remove the existing margin:
p {
margin: 0 0 1.5em; /* or 1.5em 0 0 to set the top margin */
}Mike
Oops, yeah. Sorry, I can never remember those.
Padding = inside,
Margin = outside.
(writes 200 lines)
rjain
06-27-2005, 08:55 PM
Basically I am trying to have a different spacing in the paragraph in one of the table on 1 page. In this table the headings are of different line spacing. It should look something like this.
Heading 1
(spacing a little more than using <br> so I increased the line spacing using CSS)
Paragraph 1
(Same spacing as above)
Paragraph 2
(Spacing little more than above so I used <p></p> tag for it)
Heading 2
I am attaching the code. I am not even sure right now if its doable or not. I will greatly appreciate your help.
Thank you,
<p><span class="subheading3">
<a href="events.html">Events</a></span>
<br>
<span class="p" >June 28, 2005: <a href="events.html">"How much data is enough? When should additional studies no longer be done?"</a></span>
<br>
<span class="p"> June 28, 2005: <a href="events.html">Healthcare Ethics in Action: A one-day conference that will provide basic ethics education and skills for healthcare ethics committee members.</a>
Hi,
Would anyone know how to give 1 1/2 space between 2 para in html or using CSS ? I would like to give space a little more than using <br> and less than using<p> for next para.
Thanks,
jscheuer1
06-27-2005, 09:51 PM
Not sure what you mean, if you want the space between lines in certain paragraphs to be different create classes for each type like -
In the stylesheet:
p.plushalf {
line-height:1.7;
margin-top:-.6ex;
}
In the HTML:
<p class="plushalf">Some text with<br>more spacing between lines</p>
Oddly enough the default line-height in my browser is 1.2 (used when no line-height is specified), anyways, you will need to play with these values to get the desired results which, will vary by font and browser but, generally look OK relatively speaking. The negative margin is to compensate for the fact that line-height is evenly distributed above and below each line, to get the paragraph to appear that it starts where a normal paragraph would start. Depending upon the layout, you may not need to bother with it.
mwinter
06-28-2005, 12:27 AM
Heading 1
(spacing a little more than using <br> so I increased the line spacing using CSS)Just alter the bottom margin for the heading. No need for tricks with other properties, and certainly no need to fiddle with forced line breaks.
Paragraph 2
(Spacing little more than above so I used <p></p> tag for it)
Heading 2Do you mean you want a little more spacing between a paragraph and a heading that follows it? If that's the case, then again just adjust the margin (top margin, this time) for the header.
<span class="subheading3">Umm, why? Use heading elements properly, styling their size and font style (italics and boldness) if necessary with CSS.
<span class="p" >:eek: More?
The class attribute shouldn't be used to start emulating elements that already exist. It makes a mockery of any notion of document structure. If you have headings, use heading elements. If you have paragraphs, use paragraph elements. If they don't appear quite the way you want them to, style them accordingly.
Your sample would be better marked-up as a table as there is a tabular relationship: the first column is a list of event dates, and the second column is a description of those events. Each row obviously indicates which event occurs on which date.
Mike
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.