View Full Version : Margin & Padding


Makar
10-11-2005, 05:17 AM
So like. I know if you set the margin to 0 on all for sides of the page, you can line stuff up right to the edge, without any of that whitespace. Pretty nifty. But what purpose does padding serve? I mean, thinking in terms of tables, I would think it'd do the same thing as margin, but it doesn't. 'Cause obviously if you set padding to 0 on all four sides, you still have the whitespace.

So what is it, exactly??? I'm dying to know! haha...

Monkey Bizzle
10-11-2005, 06:19 AM
I'll use a div as an example... If you set the margin to 0, then there will be no space around the outside of the div... If you set the padding to 0, then there will be no space between the edge of the div and it's contents...

Makar
10-11-2005, 01:39 PM
Ohhh, so the margin is basically for the background, and the padding is for content? Hah that totally makes sense. Thanks for clearing that up for me! :)

Monkey Bizzle
10-11-2005, 04:44 PM
Thanks for clearing that up for me! :)

No problem =)