What is the difference between padding and margin?

Question :

What is the difference between padding and margin?

In CSS, the margin is the property by which we can create space around elements. We Can even create space to the exterior define borders. In CSS have margin property as follows? Margin-top, Margin-right, Margin-bottom and margin-left Margin property has some defined values as shown below:

a. Auto: This property browser calculates the margin.

b. Length: It sets the margin value in px, pt, cm etc.

c. %: It sets the width % of the element.

d. Inherit: This property we can inherit the margin property from the parent element.

In CSS, padding is the property by which we can generate space around an element’s content As well as inside any known border; CSS padding also has properties like: Padding-top, Padding-right, padding-bottom and padding-left. Negative values are not allowed In padding.


CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad