共用方式為


right

設定相對於文件階層中之下一個定位物件右側邊緣的物件位置。

語法

{ right: sPosition }

可能的值

sPosition

指定或接收下列其中一個值的變數:

auto

預設值。以網頁之標準 HTML 版面配置為根據的預設位置。

length

浮點數,後面接著絕對單位指示項 ( cmmminptpc ) 或相對單位指示項 ( emexpx )。

如需支援之長度單位的詳細資訊,請參閱長度單位參照

percentage

整數,後面接著百分比符號 (%)。此值為父物件的高度百分比。

此屬性的預設值為 auto 。這不是繼承屬性。

備註

只能在已設定 position 屬性的情況下使用 right 屬性,否則將會忽略 right 屬性的值。

範例

此範例使用 right 屬性,將 DIV 物件設為距離它所在的位置內容右邊 50 像素:

<div style = "position:absolute; right:50px">
. . .
</div>

標準資訊

您可以在 Cascading Style Sheets (CSS), Level 2 (CSS2) (階層式樣式表 (CSS) 層級 2 (CSS2)) Ee371204.xtlink_newWindow(zh-tw,Expression.40).png 找到此屬性的定義。

適用範圍

a, abbr, acronym, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, hn, hr, i, iframe, 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, ins, li, object, ol, p, q, s, span, sub, table, td, th, tt, u, ul, var, xmp

另請參閱

概念

position