Baseline Widely available
The CSSFontFaceRule
interface represents an @font-face
at-rule.
Inherits properties from its ancestor CSSRule
.
CSSFontFaceRule.style
Read only
Returns a CSSStyleDeclaration
.
Inherits methods from its ancestor CSSRule
.
This example uses the CSS found as an example on the @font-face
page. The first CSSRule
returned will be a CSSFontFaceRule
.
@font-face {
font-family: MyHelvetica;
src:
local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"),
url("MgOpenModernaBold.ttf");
font-weight: bold;
}
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // A CSSFontFaceRule
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4