what is the padding's role on the css and html
This question already has an answer here:
As you can see in the image (shared by Josh) :
Say you have an element c with parent p.
You may notice that 1st & 3rd case look alike when only p & c are considered.
Padding is the distance from the outer border of an element to the inner part which contains the children.
+------------+
| (Padding) |
| +------+ |<--- Outer Border
| |(con- | |
| | tent)| |
Note however, that in browsers like Firefox and Chrome by default the padding gets added to the width of the element.
链接地址: http://www.djcxy.com/p/29420.html上一篇: 在CSS中何时使用填充以及何时使用边距
下一篇: 什么是填充在CSS和HTML上的作用