TOP CATEGORIES

×

What is the difference between margin and padding?

J

Jotshana

difference between margin and padding

Basic Difference Between Margin and Padding​

  • Padding refers to the inner space an element possesses, whereas the margin denotes the surrounding whitespace of an element. 
  • Regarding images, margins create space around them, separating them from text or other visual elements, while padding can be utilized to give the impression of a border around images.
  • Example: "margin: 10px 5px 15px 20px" indicates that the top margin is 10px, the right margin is 5px, the bottom margin is 15px, and the left margin is 20px.
  • Example: "padding:10px 5px 15px 20px" indicates that the top padding is 10px, the right padding is 5px, the bottom padding is 15px, and the left padding is 20px.

0 votes

Your Answer

Email: advertise@gdatamart.com

Donate: To Support US

Gdatamart.com

GDM provides information across a wide range of categories by verifying data from multiple official sources, even though the site is still being developed.

© 2025 GDATAMART.COM (All Rights Reserved)