PDA

View Full Version : CSS: reducing the space between h1 and p


Michiel
10-16-2003, 08:32 AM
Hi,

I'm currently working on a website and I encounter the follwing problem: I have got a heading 1 (<h1>) and after that comes a paragraph (<p>). I think that the space between the heading and the paragraph is too big.

I've got the idea that this can be controlled by CSS, but I'm not sure how to. Anyone got an idea on how to reduce the space between <h1> and <p>??

Thanx in advance, Michiel

liorean
10-16-2003, 09:37 AM
Try setting margin and padding of both elements to 0.

COBOLdinosaur
10-16-2003, 11:06 PM
<style>
h1 {display:inline}
.halfbr{height:25%}
</style>

Then:

<h1> your heading</h1><br class="halfbr" />
<p>
text
</p>

You will just need to adjust the percentage to get the amount of line spacing you want.

liorean
10-16-2003, 11:13 PM
My .02€ - use padding or margin on the h1 for the spacing instead.