Can anyone explain in details the difference between "margin" and "padding" in css..... | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Can anyone explain in details the difference between "margin" and "padding" in css.....

web design

18th Jun 2017, 12:40 PM
El - Mubarak
El - Mubarak - avatar
2 Respostas
+ 5
PaddingĀ is the space that's inside the element between the element and the border.Ā PaddingĀ goes around all four sides of the content and you can target and change theĀ paddingĀ for each side with CSS.Ā MarginĀ is the space between the border and next element. https://stackoverflow.com/questions/5958699/difference-between-margin-and-padding
18th Jun 2017, 12:42 PM
Louis
Louis - avatar
0
let us assume that the our content is in the square box. Now the the distance or space of the content from the border of that box is called padding while margin refers to the distance of the border of box from layout of page(page is of square or rectangle shape.
30th Jun 2017, 2:56 AM
Abhisek sharma
Abhisek sharma - avatar