Jump to content

Margin and Padding

- - - - -

  • Please log in to reply
2 replies to this topic

#1
xle_camry

xle_camry

    Programmer

  • Members
  • PipPipPipPip
  • 141 posts
Hello guys! I want exactly to understand what is the margin and what is the padding?
What are the differences between them?
Who can detailedly explain me?
Thanks in advance...

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
margin is the distance between objects or to the edge, padding is the distance from the object outline to its content
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
I think firebug demonstrates this rather nicely.

The inner most part is the content, then padding, then border, then margin.

If there is no bored the padding and margin appear to be the same, but aren't. I've found a few people got these mixed up when they started learning because of not using a border.

Here is a screenshot of a random div in firebug.

http://i51.tinypic.com/2mpjslg.jpg




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users