RE: CSS grief

by "Web Alchemy Concepts" <sales(at)webalchemy.on.ca>

 Date:  Thu, 22 Apr 2004 10:24:47 -0400
 To:  "Hwg-Style" <hwg-style(at)hwg.org>
 In-Reply-To: 
  todo: View Thread, Original
Thank you! Exactly what I was after!!! It was actually a combination of the
margin and padding plus the doc type. I always forget about the doc type
declaration and how much of an impact that can have.

Cheers,

Jeff 

-----Original Message-----
From: Jacquemin, Daniel [mailto:djacquemin(at)ets.org] 
Sent: Thursday, April 22, 2004 9:09 AM
To: 'Web Alchemy Concepts'
Subject: RE: CSS grief

Ahoy!
Don't think of the paragraph as a tag! It is a box that just happens to hold
text. The space between boxes is controlled with margin (and some would
argue padding):

http://www.w3.org/TR/REC-CSS2/box.html#box-margin-area

Setting the margin, the space between the boxes (paragraphs), will pull them
together or force them apart. Padding controls the space between the box
wall and the content. 

p { 
   margin: 0;
   padding: 0;
   }

Line height will have, as you've found, no impact on the spacing. Line
height can be used to control the space between the lines of text when a the
paragraph text wraps.
http://www.w3.org/TR/REC-CSS2/visuren.html#inline-formatting --> if you
scroll down a bit, there is a picture that shows the "line-height" of the
text with in a paragraph.

You're right in that IE and Mozilla (the Netscape rendering engine) have
problems getting the boxes to behave the same way. It has to do with how
they think about the way margin plus padding plus the width of the contents
get added together.

http://css-discuss.incutio.com/?page=BoxModelHack

Good luck with getting the paragraphs to line up as you expect. 
If you have any problems, please let me know.

- dhj


> -----Original Message-----
> From: Web Alchemy Concepts [mailto:sales(at)webalchemy.on.ca]
> Sent: Wednesday, April 21, 2004 2:03 PM
> To: Hwg-Style
> Subject: Css grief
> 
> 
> Hi all,
> 
> How do you control the spacing between paragraphs with CSS when yout 
> line-height is set at say 20 pixels. The space between the end of one 
> </p><p> is rendered as standard line height in Netscape while IE 
> displays exagerrated spacing. Is there a way to set this to a smaller 
> value that both
> IE(5 & 6) and Netscape (7) will render in a similar fashion or is that 
> asking too much?
> 
> I tried playing around with: p + p {margin-top: 2px;} and even 
> negative values which don't work in IE.
> 
> What happens when you have a table or form following a paragraph?
> 
> Thanks,
> 
> Jeff
> 
> 



**************************************************************************
This e-mail and any files transmitted with it may contain privileged or
confidential information. It is solely for use by the individual for whom it
is intended, even if addressed incorrectly. If you received this e-mail in
error, please notify the sender; do not disclose, copy, distribute, or take
any action in reliance on the contents of this information; and delete it
from your system. Any other use of this e-mail is prohibited. Thank you for
your compliance.

HWG hwg-style mailing list archives, maintained by Web Professional Association - IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.