background-origin

介绍

background-origin 规定了指定背景图片 background-image 属性的原点位置的背景相对区域。

注意:当使用 background-color 时,此属性无效。

使用示例

语法

background-origin: border-box;
background-origin: padding-box;
background-origin: content-box;

background-origin: content-box, padding-box;

取值

  • 默认值 padding-box
    背景图片的摆放以 padding 区域为参考

  • border-box
    背景图片的摆放以 border 区域为参考

  • content-box
    背景图片的摆放以 content 区域为参考

形式定义

初始值padding-box
适用元素all elements
是否支持继承no
是否支持动画no

形式语法

border-box | padding-box | content-box

与 Web 的区别

  • 不支持 inherit 模式
  • background-color 不生效

兼容性

LCD tables only load in the browser

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。