CSSPositionTryRule: name-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die name Schreibgeschützte Eigenschaft der CSSPositionTryRule-Schnittstelle repräsentiert den Namen der Fallback-Option für das Positionieren, die durch das @position-try-Regelwerk mithilfe von <dashed-ident> festgelegt wurde.
Wert
Ein String.
Beispiele
Das CSS enthält ein @position-try-Regelwerk mit dem Namen --custom-bottom 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.name); // "--custom-bottom"
Spezifikationen
| Specification |
|---|
| CSS Anchor Positioning> # dom-csspositiontryrule-name> |
Browser-Kompatibilität
Loading…