Object height 属性
页面下方有更多实例。
定义和用法
height 属性设置或返回<object> 元素的 height 属性的值。
height 属性指定对象的高度,以像素为单位。
提示:使用 width 属性设置或返回<object> 元素的 width 属性值。
浏览器支持
| 属性 | |||||
|---|---|---|---|---|---|
| height | Yes | Yes | Yes | Yes | Yes |
语法
返回 height 属性:
objObject.height
设置 height 属性:
objObject.height = pixels
属性值
| 值 | 描述 |
|---|---|
| pixels | 指定对象的高度,以像素为单位(例如 height="100") |
技术细节
| 返回值: | 一个数字,表示对象的高度,以像素为单位 |
|---|
更多实例
实例
将<object> 元素的高度和宽度更改为 300px:
document.getElementById("myObject").height = "500";
document.getElementById("myObject").width = "500";亲自试一试 »相关页面
HTML 参考手册: HTML<object> height 属性
