bottom 屬性設(shè)置定位元素下外邊距邊界與其包含塊下邊界之間的偏移。
Object.style.bottom=auto|%|length
值 | 描述 |
---|---|
auto | 默認(rèn)。通過瀏覽器計(jì)算底部的位置。 |
% | 設(shè)置元素的底邊到最近一個(gè)具有定位設(shè)置父元素的底部邊緣的百分比位置。 |
length | 使用 px、cm 等單位設(shè)置元素的底邊到最近一個(gè)具有定位設(shè)置父元素的底部邊緣的位置。可使用負(fù)值。 |
Note:如果 "position" 屬性的值為 "static",那么設(shè)置 "bottom" 屬性不會(huì)產(chǎn)生任何效果。
本例對(duì)元素的下邊進(jìn)行設(shè)置:
<html>
<head>
<style type="text/css">
input
{
position:absolute;
}
</style>
<script type="text/javascript">
function setBottomEdge()
{
document.getElementById("b1").style.bottom="100px";
}
</script>
</head>
<body>
<input type="button" id="b1" onclick="setBottomEdge()"
value="Set bottom edge to 100 px" />
</body>
</html>
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答!! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號(hào)