Hello,
I've some difficulities when using padding or margin to position an
element (alone on page alongside other elements OR inside another
parent element). Can I say usually I will use margin to position or
create some room between parent elements and padding to position or
create some room between a parent element and child elements like a
header with its links bar, search div, image div...
If someone can tell me when using margin and padding it will help
me.
Ithk to all.
PS: my question is not about absolute, fixed, relative or float
position - only when to use margin or pdding to create room between
elements.
Bergamot - 27 Jul 2007 14:24 GMT
> when to use margin or pdding to create room between elements.
Margin is outside the element borders, padding is inside. Which to use
depends on your particular design. See also
http://brainjar.com/css/positioning/

Signature
Berg
Andy Dingley - 27 Jul 2007 17:38 GMT
On 27 Jul, 14:06, adminloo...@gmail.com wrote:
> I've some difficulities when using padding or margin
If in doubt, use margin.
When you've learned how it all works, start to use padding. This might
be once you start needing borders.
Learn about "Collapsing vertical margins"
The brainjar article is one of the best resource around. It's good for
explaining float too.
Gus Richter - 27 Jul 2007 19:02 GMT
> Hello,
>
[quoted text clipped - 4 lines]
> position - only when to use margin or pdding to create room between
> elements.
Use margin to position a container and padding to position the content
(away from the container). The content itself will have its own margin
and padding, allowing for additional control/needs and remember the
border between margin and padding.

Signature
Gus