HTMLSourceElement: sizes 屬性
HTMLSourceElement 介面的 sizes 屬性是一個字串,表示一系列尺寸,用於指定資源在不同斷點下的應用尺寸。
它反映了 <source> 元素的 sizes 屬性。
值
字串。
示例
html
<source
id="el"
src="mediumVideo.mov"
type="video/quicktime"
sizes="(50em <= width <= 60px) 50em,
(30em <= width < 50em) 30em" />
js
const el = document.getElementById("el");
console.log(el.sizes); // Output: "(50em <= width <= 60px) 50em, (30em <= width < 50em) 30em"
el.sizes = "(50em <= width <= 60px) 100em, (30em <= width < 50em) 60em"; // Updates the sizes value
規範
| 規範 |
|---|
| HTML # dom-source-sizes |
瀏覽器相容性
載入中…