margin

英 [?mɑ:d??n]? ?美 [?mɑ:rd??n]??

n.邊緣,范圍;極限;利潤,盈余;(版心外)的空白

vt.留邊;成為…的邊;加邊于,圍繞;為…加旁注

復數: margins

right

英 [ra?t]? ?美 [ra?t]??

adv.立刻,馬上;向右,右邊;恰當地;一直

adj.正確的;合適的;右方的;好的,正常的

n.權利;右邊;正確,正當;右手

vt.糾正;扶直,使正;整理;補償

vi.(船舶等)復正,恢復平穩(wěn)

第三人稱單數: rights 復數: rights 現在分詞: righting 過去式: righted 過去分詞: righted

javascript marginRight 屬性 語法

作用:設置元素的右外邊距。

語法:Object.style.marginRight=auto|length|%

參數:auto ? ?瀏覽器設置的外右邊距。? ? length ? ?定義固定的外右邊距。默認值是 0。? ? % ? ?定義基于父對象總高度的百分比外右邊距。? ??

javascript marginRight 屬性 示例

<html>
<head>
<style type="text/css">
p
{ 
text-align: right
}
</style>
<script type="text/javascript">
function changeMargin()
{
document.getElementById("p1").style.marginRight="32px";
}
</script>
</head>
<body>

<input type="button" onclick="changeMargin()"
value="Change the right margin of a paragraph" />

<p>This is a paragraph</p>
<p id="p1">This is a paragraph</p>
<p>This is a paragraph</p>

</body>
</html>

運行實例 ?

點擊 "運行實例" 按鈕查看在線實例