CSSPositionTryRule: style Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die schreibgeschützte style-Eigenschaft des CSSPositionTryRule-Interfaces gibt ein CSSPositionTryDescriptors-Objekt zurück, das die in der @position-try-Atregel im Körper festgelegten Deklarationen darstellt.
Wert
Ein CSSPositionTryDescriptors-Objekt.
Beispiele
Das CSS enthält eine @position-try-Atregel mit dem Namen --custom-right und drei Deskriptoren.
css
@position-try --custom-bottom {
top: anchor(bottom);
min-width: 100px;
margin-top: 10px;
}
js
const myRules = document.styleSheets[0].cssRules;
const tryOption = myRules[0]; // a CSSPositionTryRule
console.log(tryOption.style.top); // "anchor(bottom)"
console.log(tryOption.style["min-width"]); // "100px"
console.log(tryOption.style.positionArea); // ""; no position-area specified
Spezifikationen
| Specification |
|---|
| CSS Anchor Positioning> # dom-csspositiontryrule-style> |
Browser-Kompatibilität
Loading…