height 屬性設(shè)置元素的高度。
Object.style.height=auto|length|%
值 | 描述 |
---|---|
auto | 默認(rèn)。瀏覽器會計算出實際的高度。 |
length | 使用 px、cm 等單位定義高度。 |
% | 基于其包含塊的百分比高度。 |
本例設(shè)置按鈕的高度:
<html>
<head>
<script type="text/javascript">
function setHeight()
{
document.getElementById("b1").style.height="50px";
}
</script>
</head>
<body>
<input type="button" id="b1" onclick="setHeight()"
value="Change height of button to 50 px" />
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答??! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號