For example, if a button has no padding, the text will be crowded
Also, for example, there is a small dot background image on the left side of the list, which can also be realized through padding of li
Generally, padding controls the internal margins, while margin controls the outer range. To actually position the element, margin is used. And inside the current element, how to play and position it, generally use padding
First clarify the meaning of padding and margin. Why should one be better than the other? Internal margin padding is generally the distance between the element's content and the border; margin is the outer margin, which can be understood as the distance between the borders of multiple elements.
You will understand clearly if you look at the box diagram of the element in detail!
I think this answer answers your question:
http://segmentfault.com/q/1010000000681376/a-1020000000681727
For example, if a button has no padding, the text will be crowded
Also, for example, there is a small dot background image on the left side of the list, which can also be realized through padding of li
Generally, padding controls the internal margins, while margin controls the outer range. To actually position the element, margin is used. And inside the current element, how to play and position it, generally use padding
First clarify the meaning of padding and margin. Why should one be better than the other? Internal margin padding is generally the distance between the element's content and the border; margin is the outer margin, which can be understood as the distance between the borders of multiple elements.
You will understand clearly if you look at the box diagram of the element in detail!