Previous Message
Next Message

Margins/Padding Between H1 and P Tags

Sent by Adam Kuehn on 17 December 2004 19:07


Anthony Baker wrote:

>What's the most reliable way of cutting down on the built-in spacing 
>that comes between <h1></h1> and <p> tags? I'd like to be able to 
>reduce the space when a <p> tag comes after an </h1> without 
>altering the <p> tag to affect spacing between further <p></p> 
>elements.

The most common way is to remove the bottom margin from the header 
(or change it to whatever value you prefer between the header and the 
following text), and also remove the top-margin from your paragraphs. 
The vertical margins on adjacent paragraphs collapse, so this will 
not reduce the space between paragraphs and will still leave a margin 
at the end of the string of paragraphs.  The are other ways, as well, 
including adding classes for more specific effects, but this is the 
most general and involves no addition to the markup.

HTH,

-- 

-Adam Kuehn
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: