Home » questions » Could anyone please point out the differences between "padding" and "margin" attribute in CSS layout

Could anyone please point out the differences between "padding" and "margin" attribute in CSS layout

2006-08-03 22:08:49, Category: Programming & Design

Answers

  1. AmandaKerik

    On 2006-08-03 23:42:56


    This is called the CSS Box Model. Padding is the space inside the border between the border and the actual contents. Like padding in a jewelry box. Margins are the spaces outside the border, between the border and the rest of the page. Like breathing room. Keep in mind that Internet Explorer doesn't implement the box model correctly. This means that your pages will look different (and sometimes vastly different) in other browsers. Code for Firefox, tweak for IE and Opera.
  2. duct_tape_is_good

    On 2006-08-03 22:13:22


    padding will push the object around in relation to other objects. margin will push other objects around in relation to the object.
  3. Samip

    On 2006-08-03 22:30:33


    Padding means like the space which we want to keep between the two consecutive structure like a cells of a table called cell padding and margin limits your layout of the css file. it defines the all four margins on top,left,bottom and right of the page got it. So padding is internal spacing and margin are boundary to the page.