Re: Style Sheet Equiv Question

by "Darrell King" <darrell(at)>

 Date:  Sun, 10 Mar 2002 07:38:51 -0500
 To:  "HWG Techniques" <hwg-techniques(at)>
 References:  computer zydhek1 king zydhek12
  todo: View Thread, Original
The padding is the space between the border of an element and the content of
that element.

The margin is the space between the border of an element and the adjacent
elements or content.

It seems to make more sense to me to use margin with HTML's img tag, as
there may not be any padding between the border of an image and the image
content, but there might be space between the border and the adjacent
elements or content (such as your text.)

In CSS presentation, more so than with older HTML presentation, I think
there is a need to understand more than just validation or "it works!".  I
believe we need to understand a higher level of structural detail than ever
before, as we are moving into layout scenarios as complex as any the print
industry has ever tackled...with platform issues thrown in to keep it

Padding and margin often give similar visual effects, but are structurally
different properties.  Perhaps I am being too concerned over tiny details
here, but I have a feeling they are going to be important...


----- Original Message -----

Margins, padding... I guess on the site I'm working on, where I'm trying to
keep everything validating to XHTML Strict, the two act about the same. In
my use, I've been using margins for just that: margins, and using padding
for adding space around things I don't want bumping into each other... To be
honest, I can't actually think of any explicit differences between Margins
and Padding... they both seem to do the same exact thing, unless I'm drawing
a border or line, where they do affect where that is placed...

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA