HTMLEmbedElement:width 屬性

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

HTMLEmbedElement 介面的 width 屬性返回一個字串,該字串反映了 <embed> 元素的 width 屬性,表示資源在 CSS 畫素中的顯示寬度。

一個字串,表示資源在 CSS 畫素中的顯示寬度。

示例

html
<embed id="el" width="800" height="600" />
js
const el = document.getElementById("el");
console.log(el.width); // Output: '800'

規範

規範
HTML
# dom-dim-width

瀏覽器相容性

另見