HTML DOM paddingBottom ÊôÐÔ
¶¨ÒåºÍÓ÷¨
paddingBottom ÊôÐÔÉèÖÃÔªËØµÄÏÂÄڱ߾ࡣ
padding ÊôÐÔ¶¨ÒåÔªËØ±ß¿òÓëÔªËØÄÚÈÝÖ®¼äµÄ¿Õ¼ä¡£
Óï·¨£º
Object.style.paddingBottom=length|%
¿ÉÄܵÄÖµ
Öµ | ÃèÊö |
---|---|
length | ¶¨Òå¹Ì¶¨µÄÏÂÄڱ߾àÖµ¡£Ä¬ÈÏÖµÊÇ 0¡£ |
% | ¶¨Òå»ùÓÚ¸¸ÔªËظ߶ȵİٷֱÈÏÂÄڱ߾ࡣ´ËÖµ²»»áÈçÔ¤ÆÚµÄÄÇÑù¹¤×÷ÓÚËùÓеÄä¯ÀÀÆ÷ÖС£ |
ʵÀý
ÏÂÃæµÄÀý×ӸıäÔªËØµÄÏÂÄڱ߾ࣺ
<html>
<head>
<style type="text/css">
p
{
border: thin dotted #FF0000;
}
</style>
<script type="text/javascript">
function changePadding()
{
document.getElementById("p1").style.paddingBottom="2cm";
}
</script>
</head>
<body>
<input type="button" onclick="changePadding()"
value="Change bottom padding" />
<p id="p1">This is a paragraph</p>
</body>
</html>