marginBottom 屬性設(shè)置元素的下外邊距。
Object.style.marginBottom=auto|length|%
值 | 描述 |
---|---|
auto | 瀏覽器設(shè)置的一個(gè)下外邊距。 |
length | 定義一個(gè)固定的下外邊距。默認(rèn)值是 0。 |
% | 定義基于父對象總高度的百分比下外邊距。 |
本例改變段落的下外邊距:
<html>
<head>
<script type="text/javascript">
function changeMargin()
{
document.getElementById("p1").style.marginBottom="32px";
}
</script>
</head>
<body>
<input type="button" onclick="changeMargin()"
value="Change the bottom 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í)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答??! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號