HTML DOM marginBottom ÊôÐÔ
¶¨ÒåºÍÓ÷¨
marginBottom ÊôÐÔÉèÖÃÔªËØµÄÏÂÍâ±ß¾à¡£
Óï·¨£º
Object.style.marginBottom=auto|length|%
¿ÉÄܵÄÖµ£º
Öµ | ÃèÊö |
---|---|
auto | ä¯ÀÀÆ÷ÉèÖõÄÒ»¸öÏÂÍâ±ß¾à¡£ |
length | ¶¨ÒåÒ»¸ö¹Ì¶¨µÄÏÂÍâ±ß¾à¡£Ä¬ÈÏÖµÊÇ 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>