Page selectors
The :first, :left, and :right pseudo-classes select pages based on their position in sequence after pagination.
Overview
The :first, :left, and :right pseudo-classes select pages based on their position in sequence after pagination.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 18 | 12 | 116 | 6 | 18 | 6 | |
| Other | ||||||
| Left-hand page pseudo-class (`:left`) | 6 | 12 | | 5 | 18 | 4.2 |
| Right-hand page pseudo-class (`:right`) | 6 | 12 | | 5 | 18 | 4.2 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
@page :first {
margin-top: 50mm;
}
@page :left {
margin-left: 30mm;
}
@page :right {
margin-right: 30mm;
} Live demo
Use cases
Using Page selectors
The :first, :left, and :right pseudo-classes select pages based on their position in sequence after pagination.
Cautions
- Limited browser support. Check compatibility before use.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features