background-origin

important note重要訊息:

本文件為初步資訊而且可能隨時變更。

設定一或多個方塊的背景定位區域。

語法

{ background-origin: sPosition }

可能的值

sPosition

指定方塊位置的字串。

padding-box

預設值。此位置是相對於邊框間距方塊。在單一方塊中,"0 0" 是邊框間距邊緣的左上角,"100% 100%" 則是右下角。

border-box

此位置相對於框線方塊。

content-box

此位置是相對於內容方塊。

此屬性的預設值為 padding-box 。這不是繼承屬性。

備註

對於呈現成單一方塊的元素, background-origin 屬性可指定背景的定位區域。對於呈現成多個方塊的元素 (例如跨行的內嵌方塊或跨頁的方塊),此屬性則可指定要以哪些方塊來決定背景的定位區域。

如果這個影像的 background-attachment 值是 fixed ,則 background-origin 屬性不會有任何作用。在這種情況下,背景定位區域就是初始的包含區塊。

方塊的背景可以有多個圖層。圖層數目是由 background-image 屬性中逗號分隔值的數目所決定。每個影像的大小、位置和並排方式都是根據其他背景屬性 ( background-attachment , background-clipbackground-originbackground-positionbackground-repeatbackground-size ) 中的對應值來設定。清單中的第一個影像是最接近使用者的圖層,第二個影像顯示在第一個影像後面,依此類推。

標準資訊

您可以在 CSS Selectors Level 3 (CSS 選取器層級 3) Gg721756.xtlink_newWindow(zh-tw,Expression.40).png 找到此屬性的定義。

適用範圍

a, address, b, big, blockquote, body, button, caption, center, cite, code, col, colgroup, custom, dd, defaults, dfn, div, dl, dt, em, fieldset, form, hn, html, i, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, li, ol, p, s, span, sub, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var, xmp

另請參閱

概念

background
background-attachment
background-clip
background-color
background-image
background-origin
background-position
background-repeat
background-size