CKTIS / CSS
:right — right-hand pages in @page
The :right page pseudo-class selects right-hand pages in paginated output, such as printing. Use it in @page, typically to define asymmetric page margins.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
@page :right { margin-left: 30mm; }:right is a page pseudo-class used in an @page rule’s selector. It selects pages on the right-hand side of a spread, not HTML elements on the right side of the screen. It is not the positioning property right.
The browser classifies pages as :left or :right according to page progression. With horizontal left-to-right writing, the first page is right-hand by default; nevertheless, do not treat :right as a universal synonym for odd-numbered pages. This classification also applies to single-sided printing.
Declarations in @page :right affect the page context, not the styles of its elements. For the same property, this rule has greater specificity than plain @page; @page :first has greater specificity than @page :right. The pseudo-class itself does not enable duplex printing.
The example creates three pages using forced page breaks. Under the stated settings, pages 1 and 3 should have asymmetric margins, while page 2 uses the base margins. Evaluate the result in print preview or PDF, not the normal screen view. The result requires local verification.
Examples
<!doctype html>
<html lang="en" dir="ltr">
<meta charset="utf-8">
<title>Right pages</title>
<style>
@page { size: A4; margin: 20mm; }
@page :right { margin-left: 30mm; margin-right: 10mm; }
body { margin: 0; }
section + section { page-break-before: always; }
</style>
<section>Page 1</section>
<section>Page 2</section>
<section>Page 3</section>
</html>Result
Expected print layout: three pages. Pages 1 and 3 have a 30mm left margin and a 10mm right margin. Page 2 has 20mm margins on both sides. All pages have 20mm top and bottom margins.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.