height 属性设置元素的高度。
</>code
- Object.style.height=auto|length|%
值 | 描述 |
---|---|
auto | 默认。浏览器会计算出实际的高度。 |
length | 使用 px、cm 等单位定义高度。 |
% | 基于其包含块的百分比高度。 |
本例设置按钮的高度:
</>code
- <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>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号