margin

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

#n.邊緣,範(fàn)圍;極限;利潤(rùn),盈餘;(版心外)的空白

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

複數(shù): margins

right

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

adv.立刻,馬上;向右,右邊;恰當(dāng)?shù)?一直

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

n.權(quán)利;右邊;正確,正當(dāng);右手

vt.修正;扶直,使正;整理;補(bǔ)償

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

第三人稱(chēng)單數(shù): rights 複數(shù): rights 現(xiàn)在分詞: righting 過(guò)去式: righted 過(guò)去分詞: righted

javascript marginRight 屬性 語(yǔ)法

作用:設(shè)定元素的右外邊距。

語(yǔ)法:Object.style.marginRight=auto|length|%

參數(shù):auto ? ?瀏覽器設(shè)定的外側(cè)間距。? ? length ? ?定義固定的外右距。預(yù)設(shè)值是 0。? ? % ? ?定義基於父物件總高度的百分比外右邊距。? ??

#

javascript marginRight 屬性 範(fàn)例

<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>

執(zhí)行實(shí)例 ?

點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線(xiàn)上實(shí)例