backgroundOrigin 属性设置或返回background-position 属性的相对位置。
笔记:如果背景图片的background-attachment 属性为"fixed",则此属性无效。
返回backgroundOrigin属性:
object.style.backgroundOrigin
设置backgroundOrigin属性:
object.style.backgroundOrigin = "padding-box|border-box|content-box|initial|inherit"
Value | Description |
---|---|
padding-box | Default value. The background image is positioned relative to the padding box |
border-box | The background image is positioned relative to the border box |
content-box | The background image is positioned relative to the content box |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
默认值: | 填充盒 |
---|---|
返回值: | 一个字符串,表示元素的背景原点属性 |
CSS版本 | CSS3 |
backgroundOrigin
是 CSS3 (1999) 的一项功能。
所有浏览器都完全支持它:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!