Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

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-Eigenschaft der CSSPositionTryRule-Schnittstelle ist schreibgeschützt und repräsentiert den Namen der Zurückfaller-Option für die Position, die durch die @position-try-Regel mit <dashed-ident> spezifiziert wird.

Wert

Ein String.

Beispiele

Das CSS enthält eine @position-try-Regel mit einem 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

Siehe auch