HTMLFencedFrameElement: width 屬性
HTMLFencedFrameElement 的 width 屬性用於獲取和設定相應的 <fencedframe> width 屬性值,該屬性指定了元素的寬度。
嵌入內容的尺寸可以透過 <fencedframe> 的 config 物件的內部 contentWidth 和 contentHeight 屬性來設定。在這種情況下,更改 <fencedframe> 的 width 或 height 會更改頁面上嵌入容器的大小,但容器內的文件將被視覺縮放以適應。嵌入文件報告的寬度和高度(即 Window.innerWidth 和 Window.innerHeight)將保持不變。
值
一個字串,表示元素以 CSS 畫素為單位的寬度。預設值為 300。
示例
js
const frame = document.createElement("fencedframe");
frame.width = "480";
規範
| 規範 |
|---|
| 圍欄框架 # dom-htmlfencedframeelement-width |
瀏覽器相容性
載入中…
另見
- privacysandbox.google.com 上的Fenced frames
- 隱私沙盒(位於 privacysandbox.google.com)