嵌入檔案的 height 屬性
描述
height 屬性用於設定或返回 <embed> 元素的 height 屬性值。
height 屬性指定嵌入內容的畫素高度。
提示: 使用 width 屬性來設定或返回 <embed> 元素的 width 屬性值。
瀏覽器支援
屬性 | |||||
---|---|---|---|---|---|
height | 是 | 是 | 是 | 是 | 是 |
語法
返回 height 屬性
embedObject.height
設定 height 屬性
embedObject.height = pixels
屬性值
值 | 描述 |
---|---|
畫素 | 以畫素為單位指定嵌入內容的高度(例如 height="100") |
技術詳情
返回值 | 一個 Number,表示嵌入內容的畫素高度 |
---|
更多示例
示例
將嵌入檔案的 height 和 width 設定為 500 畫素
document.getElementById("myEmbed").height = "500";
document.getElementById("myEmbed").width = "500";
自己動手試一試 »
相關頁面
HTML 參考: HTML <embed> height 屬性
❮ 嵌入物件