HTMLFencedFrameElement: height 属性
HTMLFencedFrameElement 接口的 height 属性用于获取和设置相应的 <fencedframe> height 属性的值,该属性指定了元素的高度。
嵌入式内容的大小可以通过 <fencedframe> 的 config 对象的内部 contentWidth 和 contentHeight 属性来设置。在这种情况下,更改 <fencedframe> 的 width 或 height 会改变页面上嵌入式容器的大小,但容器内的文档将被视觉缩放以适应。嵌入式文档报告的宽度和高度(即 Window.innerWidth 和 Window.innerHeight)将保持不变。
值
一个字符串,表示元素的高度(以 CSS 像素为单位)。默认值为 150。
示例
js
const frame = document.createElement("fencedframe");
frame.height = "320";
规范
| 规范 |
|---|
| 围栏框架 # dom-htmlfencedframeelement-height |
浏览器兼容性
加载中…
另见
- privacysandbox.google.com 上的Fenced frames
- 隐私沙盒(位于 privacysandbox.google.com)