Gene Falck wrote:
> Hi Liz,
> 
> You wrote (to Steve Clason):
> 
>> Your code with the p worked perfectly until I wanted a paragraph break not
>> under a header.  Just a normal one. I didn't get a double space.  I tried
>> adding the paragraph space back in like I did the headers but ended up with
>> space again under the headers.   I really am new to css so what might be
>> obvious to someone else is not to me such as how to add the space back in.

> Basically I set all the margins and padding
> to zero then on the top element (H1 usually
> for me) I set the top margin that looks about
> right for the document as a whole. I then use
> bottom margins for the space I want below the
> various items--no margin overlap problems and,
> in most of the things I write, the amount that
> looks right to me is usually a matter of the
> spacing down from the item above.

Gene suggests exactly what I would. So you could have something like:

h1, h2, h3, p {margin:0;padding:0;} /*You could add other elements*/

h1 {margin-top:2em; margin-bottom: 1em}
h2 {margin-bottom:2em}
h3 {margin-bottom:0} /*this is redundant*/
p {margin-bottom: 1em}

So now you would have no margin between the h3 and the following 
paragraph, but subsequent paragraphs would be separated from the 
previous one.

CSS2 contains the adjacent sibling selector, so in a perfect world you 
could just do:

h3 + p {margin-top: 0;}

and every paragraph that immediately followed an h3 would have no top 
margin, but this is poorly supported and you're better off following 
Gene's suggestion.



--
Steve Clason
Web Design & Development
Boulder, Colorado, USA
www.topdogstrategy.com
(303)818-8590

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to