CSSPositionTryRule: Eigenschaft name
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die name
-Eigenschaft der CSSPositionTryRule
-Schnittstelle ist eine schreibgeschützte Eigenschaft, die den Namen der Fallback-Option für Positionsversuche darstellt, die durch die @position-try
-At-Regel mit der <dashed-ident>
angegeben ist.
Wert
Ein String.
Beispiele
Das CSS beinhaltet eine @position-try
-At-Regel mit dem Namen --custom-bottom
und drei Deskriptoren.
css
@position-try --custom-bottom {
top: anchor(bottom);
min-width: 100px;
margin: 10px 0 0 0;
}
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 |