margin
英 [?mɑ:d??n]? ?美 [?mɑ:rd??n]??
n.邊緣,范圍;極限;利潤,盈余;(版心外)的空白
vt.留邊;成為…的邊;加邊于,圍繞;為…加旁注
復(fù)數(shù): margins
left
英 [left]? ?美 [l?ft]??
adj.左邊的,左側(cè)的;左派的
n.左,左面;[軍]左翼;左派,激進(jìn)分子
adv.向左;在左邊
v.離開( leave的過去式和過去分詞)
復(fù)數(shù): lefts
javascript marginLeft屬性 語法
作用:設(shè)置元素的左外邊距。
語法:Object.style.marginLeft=auto|length|%
參數(shù):auto ? ?瀏覽器設(shè)置的左外邊距。? ? length ? ?定義固定的左外邊距。默認(rèn)值是0。? ? % ? ?定義基于父對象總高度的百分比左外邊距。? ??
javascript marginLeft屬性 示例
<html> <head> <script type="text/javascript"> function changeMargin() { document.getElementById("p1").style.marginLeft="32px"; } </script> </head> <body> <input type="button" onclick="changeMargin()" value="Change the left 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>
運(yùn)行實(shí)例 ?
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例