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