好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS3中background-origin和background-clip的区别_html/css

background-origin:to determine how the background-position of a background in a certain box is calculated. background-clip:to determine whether the backgrounds extends into the border or not.

用通俗一点的话说,其实就是:

background-origin:用来确定背景从哪里开始描绘 background-clip:用来确定背景从哪里开始显示(其实从origin和clip的字面意思也可以感受出来,clip是剪切嘛),背景可以延伸到哪。

它们的取值都有三个:border-box | padding-box | content-box, 其中background-origin的默认值是padding-box,background-clip的默认值是border-box。

以下的例子应该能更直白地表现它们的区别:

先写一个

查看更多关于CSS3中background-origin和background-clip的区别_html/css的详细内容...

  阅读:29次