CSSPageRule: selectorText-Eigenschaft
Die selectorText
-Eigenschaft der CSSPageRule
-Schnittstelle erhält und setzt die Selektoren, die mit der CSSPageRule
verbunden sind.
Wert
Ein String.
Beispiele
Das Stylesheet enthält zwei @page
-Regeln. Die selectorText
-Eigenschaft gibt den buchstäblichen Selektortext von :first
als String zurück.
css
@page {
margin: 1cm;
}
@page :first {
margin: 2cm;
}
js
let myRules = document.styleSheets[0].cssRules; //returns two myRules
console.log(myRules[1].selectorText); // returns the string ":first"
Spezifikationen
Specification |
---|
CSS Object Model (CSSOM) # dom-csspagerule-selectortext |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
selectorText |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.