QA.TechInterviews.com - your tech questions answered
Could Anyone Please Point Out The Differences Between "Padding" And "Margin" Attribute In CSS Layout

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.
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.
padding will push the object around in relation to other objects.

margin will push other objects around in relation to the object.
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.

Back to QA. TechInterviews.com. Powered by Yahoo! Answers and TechInterviews.com community.