Scott Povlot wrote: > I think this is a simple question. And perhaps there > is no straight answer. > > If I don't have a border, what is the difference > between using padding or margin to add space around an > element? Is there any reason to choose one over the > other? > Hi Scott,
I guess it depends on what will be adjacent to the element and how the current element needs to interact with it. In some cases, the visual aspect of margin or padding are identical, but the underlying structure is not. A paragraph within a div which has padding: 20px; declared, will be 20px from the div edge. margin: 20px; will make sure the /div/ is never closer than 20px from an adjacent element. At the risk of stating what's clear, margin pushes the element from it's adjacent cousins while padding refers to the usable space within the element. More info on the box model is avail at w3.org [1] and many other places. I hope this helps. Kind regards, ~Ray [1] http://www.w3.org/TR/REC-CSS2/box.html ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
