Editor's Draft · css-navigation
CSS Navigation Matching
2 at-rules, 2 selectors, 1 function defined by this
specification, 1 of them known to at least one browser
(the others are badged Not in any browser yet).
Read the Editor's Draft ↗
Each feature in detail
Spec The @location rule is an at-rule that associates an author-defined name with a URL pattern. This name can be referenced in @navigation rules and in :link-to() pseudo-classes.
Syntax
<location-rule>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec The @navigation rule is a conditional group rule whose condition tests characteristics of the current URL or of the state of navigation between two URLs. These queries are called navigation queries.
Syntax
@navigation <navigation-condition> { <rule-list> }
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗
Spec This specification defines a new :link-to() functional pseudo-class that matches link elements that link to a certain URL.
Specification ↗
Spec This specification defines a :navigation-source pseudo-class, matching the element that triggered the current navigation. It is a CSS reflection of the sourceElement property in the Navigation API. The trigger element can be an [^a^], [^area^], [^form^], a [^input/type/submit^] input, or a [^button^].
Syntax
:navigation-source
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting :navigation-source | Chrome | 156 |
| Edge | 156 |
| Firefox | No |
| Safari | No |
| Chrome Android | 156 |
| Safari iOS | No |
First version with support, from MDN browser-compat-data.
Specification ↗
Spec The url-pattern() function represents a URL pattern, which can be used to match URLs.
Syntax
url-pattern( <string> )
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Specification ↗