HTMLFencedFrameElement:width 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

HTMLFencedFrameElementwidth 属性用于获取并设置对应 <fencedframe> 元素的 width 属性的值,该属性指定了元素的宽度。

嵌入内容的尺寸可能由 <fencedframe>config 对象的内部 contentWidthcontentHeight 属性设置。在这种情况下,更改 <fencedframe>widthheight 将改变页面上嵌入容器的大小,但容器内的文档将按比例缩放以适应新的尺寸。嵌入文档报告的宽度和高度(即 Window.innerWidthWindow.innerHeight)将保持不变。

以 CSS 像素为单位表示元素宽度的字符串。默认值为 300

示例

js
const frame = document.createElement("fencedframe");
frame.width = "480";

规范

Specification
Fenced Frame
# dom-htmlfencedframeelement-width

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
width
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

参见