background
填充区域默认为content、padding和border区域。
然而该行为由background-clip
属性决定,默认为border-box
。
该属性对应的 background
填充对应区域如下:
background-clip | margin | border | padding | content | text |
---|---|---|---|---|---|
border-box (默认) | ✘ | ✔ | ✔ | ✔ | - |
padding-box | ✘ | ✘ | ✔ | ✔ | - |
content-box | ✘ | ✘ | ✘ | ✔ | - |
text (webkit) | ✘ | ✘ | ✘ | ✘ | ✔ |