October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
@page

The CSS @page Rule: Set Paper Size, Margins, Orientation, and Understand Bleed

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use @page to define the page box used by print and print-to-PDF output. Set size for paper dimensions and orientation, margin (or side-specific margins) for the printable area, and page selectors for first, left, right, or named pages. These declarations express intent; the browser, PDF renderer, printer, and print-dialog choices still determine how that page box reaches a physical sheet. Bleed and crop marks are defined by the CSS Paged Media specification, but current browsers do not support those descriptors.

What @page controls

The CSS Paged Media model lays a document into finite rectangular page boxes. An @page rule supplies dimensions and margins for those boxes when a user agent produces paged output, such as a print preview, printed sheet, or PDF. It does not style the normal screen viewport.

Put document styling in @media print and page-box declarations in @page. They work together:

@media print {
  /* Hide or restyle document content for print */
  nav,
  .cookie-banner,
  .screen-only {
    display: none;
  }

  @page {
    size: A4 portrait;
    margin: 18mm;
  }
}

The W3C CSS Paged Media Level 3 draft notes that transferring a page box to a physical sheet is device dependent. Consequently, CSS cannot force every printer or print dialog to accept a particular tray, paper stock, or driver setting. Always inspect the output path you actually ship: a browser’s print preview, its built-in PDF destination, or a dedicated PDF renderer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Multipurpose Copy Printer Paper, 8.5 x 11 Inches, 20 lb, 92 Bright, White, 1 Ream (500 Sheets), Jam-Free
  • 1 ream (500 sheets) of 8.5 x 11 white copier and printer paper for home or office use
  • Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
  • Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
  • Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
  • Virgin copy paper providing professional quality results; acid-free to prevent yellowing

References: MDN @page and the CSS Paged Media Module Level 3 Working Draft (2023-09-14).

Set paper size with the size descriptor

size accepts a scalable keyword, a named paper format, or one or two lengths. With two lengths, the first is width and the second height. A single length creates a square page box.

Form Meaning Example
auto User agent chooses the page size. size: auto;
Orientation keyword Uses the selected format’s portrait or landscape dimensions. size: A4 landscape;
Named format Predefined paper size such as A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, or ledger. size: letter;
Two lengths Custom width followed by height. size: 210mm 297mm;

For example, a US letter report with half-inch margins is:

@page {
  size: letter portrait;
  margin: 0.5in;
}

A custom landscape report can use absolute dimensions:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@page report {
  size: 11in 8.5in;
  margin: 0.5in;
}

The output device or user agent maps that page box to a sheet. If the print dialog is set to a different paper size, the result may be scaled, clipped, or placed on the selected stock rather than producing the physical dimensions you intended.

Rank #2
HP Printer Paper | 8.5 x 11 Paper | Copy &Print 20 lb | 1 Ream Case - 500 Sheets| 92 Bright | FSC Certified | 200060
  • HP Papers is sourced from renewable forest resources and has achieved production with 0% deforestation in North America. Each ream is wrapped in a polyurethane coated paper wrapper to protect the cut sheets from moisture damage
  • Sheet size – 8.5 x 11; Thickness – 20 pounds; Brightness – 92 bright white
  • HP Copy&Print20 20 pounds printer paper is Forest Stewardship Council (FSC) certified and contributes toward satisfying credit MR1 under LEED (Leadership in Energy and Environmental Design)
  • All HP Papers provide premium performance on HP equipment, as well as on all other printer and copier equipment; 100% satisfaction guaranteed; ColorLok technology provides more vivid colors, bolder blacks and faster drying
  • Superior quality, reliability, and dependability for high-volume printing at home, at school and in the office; HP Copy&Print20 print and copy paper prevents yellowing over time to ensure a long-lasting appearance for added archival quality

Named pages and page subsets

A named page rule applies when an element requests that page name with the page property:

@page cover {
  size: A4 portrait;
  margin: 0;
}

@page chapter {
  size: A4 portrait;
  margin: 18mm 20mm 22mm;
}

.cover { page: cover; }
.chapter { page: chapter; }

Page pseudo-classes target subsets of generated pages. For example:

@page :first {
  margin-top: 30mm;
}

@page :left {
  margin-left: 25mm;
  margin-right: 15mm;
}

@page :right {
  margin-left: 15mm;
  margin-right: 25mm;
}

These controls affect paged output, not ordinary screen layout. The exact behavior of named pages and margin handling should be checked in your target engine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Control margins and printable area

The margin descriptor follows the familiar one-to-four-value shorthand: one value applies to all sides; two set top/bottom and left/right; three set top, horizontal, and bottom; four set top, right, bottom, and left. Side-specific descriptors such as margin-top and margin-bottom can be used when a page needs different gutters.

@page {
  size: A4;
  margin: 16mm 14mm 20mm 14mm;
}

@page :first {
  margin-top: 28mm;
}

Margins reserve space around the page area. They do not guarantee that a desktop printer can print to the sheet edge; hardware often has a non-printable region. For borderless work, verify the printer’s capabilities and the print dialog’s scaling and margin settings.

Rank #3
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 3 Reams (1,500 Sheets), 92 Bright White for Home Use
  • 3 ream case (1,500 sheets) of 8.5 x 11 white copier and printer paper for home or office use
  • Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
  • Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
  • Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
  • Virgin copy paper providing professional quality results; acid-free to prevent yellowing

Landscape dimensions versus page-orientation

For most documents, choose landscape by changing the page box dimensions:

@page {
  size: A4 landscape;
}

This describes a page box whose width exceeds its height. The separate page-orientation descriptor requests a rotation after layout. That distinction matters when content must be laid out in one direction and then rotated for output:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@page rotated {
  size: A4;
  page-orientation: rotate-left;
}

.rotated-section { page: rotated; }

MDN documents the post-layout behavior. Support is less uniform than for basic size; test the exact browser or PDF engine before relying on it. Do not use page-orientation as a synonym for size: landscape.

Bleed, crop marks, and registration marks

The W3C draft defines bleed as an area extending beyond the page box and marks values for crop or registration marks:

@page {
  size: 210mm 297mm;
  bleed: 3mm;
  marks: crop cross;
}

In that draft, bleed: auto computes to 6pt when crop marks are requested and to zero otherwise. This is specification behavior, not a browser guarantee. MDN’s paged-media guide states that browsers currently do not support the bleed and marks descriptors. A browser print or PDF workflow therefore should not be promised to emit trim or registration marks. For commercial print, use a renderer or prepress workflow that explicitly supports them, and confirm its documentation.

Rank #4
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 5 Reams (2,500 Sheets), 92 Bright White
  • 5 ream case (2,500 sheets) of 8.5 x 11 white copier and printer paper for home or office use
  • Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
  • Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
  • Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
  • Virgin copy paper providing professional quality results; acid-free to prevent yellowing

A reliable browser print workflow

  1. Separate screen and print rules. Put visibility, colors, typography, and page-break behavior in @media print.
  2. Declare the page box. Start with a named size such as A4 or letter, then add portrait or landscape.
  3. Set margins. Use physical units such as mm or in for predictable print intent.
  4. Preview the real destination. In the browser print dialog, select the intended paper, disable unexpected scaling, and compare the PDF and physical print if both matter.
  5. Test page breaks and assets. Long tables, substituted fonts, lazy images, and unavailable network resources can change pagination even when @page is correct.
  6. Test every supported engine. Browser support for individual paged-media descriptors varies, and a dedicated PDF renderer may paginate differently.

Minimal test document

<!doctype html>
<html>
<head>
<style>
@media print {
  @page {
    size: A4 landscape;
    margin: 15mm;
  }
  body { font: 10pt/1.4 Arial, sans-serif; }
  .avoid-break { break-inside: avoid; }
}
</style>
</head>
<body>
  <h1>Landscape report</h1>
  <section class="avoid-break">Content to keep together.</section>
</body>
</html>

Open it, choose the browser’s print or Save to PDF destination, and verify the reported paper size, orientation, margins, and page count. This catches mistakes such as a stylesheet loaded only after print preview opens.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failures and fixes

The print dialog still shows the wrong paper

Check that the rule is valid, loaded before printing, and inside the document’s print stylesheet. Then check the dialog’s paper-size and scaling controls. CSS expresses the page box; the user agent and device control sheet transfer.

Landscape content is rotated or clipped

Use size: A4 landscape for ordinary landscape output. Reserve page-orientation for a tested engine because it rotates after layout. Also check that the selected physical paper matches the CSS dimensions.

Margins appear larger than declared

Printer hardware may have a non-printable edge, and the dialog may add margins or scaling. Compare a PDF destination with a physical printer and inspect both the browser’s margin setting and printer driver.

Bleed or crop marks do not appear

That is expected in current browsers: MDN reports no browser support for these descriptors. Use a paged-media/prepress renderer with documented bleed and marks support instead of relying on browser CSS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 8 Reams (4,000 Sheets), 92 Bright White, Great for Crisp Ink Printing
  • 8 ream case (4,000 sheets) of 8.5 x 11 white copier and printer paper for home or office use
  • Multipurpose letter size copy paper works with laser/inkjet printers, copiers and fax machines
  • Smooth 20lb weight paper for consistent ink and toner distribution; dries quickly and resists paper jams
  • Bright white paper (92 GE; 104 Euro) offers great contrast for crisp printing and vivid color
  • Virgin copy paper providing professional quality results; acid-free to prevent yellowing

Different PDFs paginate differently

Fonts, image loading, JavaScript timing, viewport defaults, and renderer implementations all affect line wrapping and page breaks. Bundle fonts where licensing permits, wait for images and data before invoking print, and test the exact browser or renderer version used in production.

Automated capture without configuring a browser

If your goal is a repeatable screenshot or PDF of a page rather than interactive printer output, ScreenshotNeo provides a website screenshot API and MCP server. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result.

Or skip the browser setup

One GET request can return PNG, JPEG, WebP, or PDF. The API supports full-page capture with lazy images loaded, custom viewport and device presets, CSS/JavaScript injection, waiting for selectors or network idle, and PDF paper size, margins, landscape, and page ranges. See the ScreenshotNeo documentation for all options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Choosing a page-output strategy

Need Best starting point Important qualification
Normal browser print or PDF @media print plus @page Final sheet transfer and descriptor support vary by user agent and device.
Automated website image or PDF ScreenshotNeo API or MCP Its output depends on capture options, page readiness, and the target site’s behavior.
Commercial bleed and registration marks Dedicated paged-media/prepress renderer Confirm explicit support; browser bleed and marks are not currently supported.

Frequently Asked Questions

Can CSS force a printer to use a specific tray or paper stock?

No. @page describes the page box, while the user agent, print dialog, printer driver, and device handle the transfer to physical media.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use millimeters or inches in @page?

Use either physical unit for print-oriented dimensions; choose the unit that matches your specification and test the resulting PDF or print path.

Does @page change the web page users see on screen?

No. It applies to paged output. Use ordinary screen CSS for the viewport and @media print for print-only document styling.

Quick Recap

Bestseller No. 1
Amazon Basics Multipurpose Copy Printer Paper, 8.5 x 11 Inches, 20 lb, 92 Bright, White, 1 Ream (500 Sheets), Jam-Free
Amazon Basics Multipurpose Copy Printer Paper, 8.5 x 11 Inches, 20 lb, 92 Bright, White, 1 Ream (500 Sheets), Jam-Free
1 ream (500 sheets) of 8.5 x 11 white copier and printer paper for home or office use; Virgin copy paper providing professional quality results; acid-free to prevent yellowing
$6.97
Bestseller No. 2
HP Printer Paper | 8.5 x 11 Paper | Copy &Print 20 lb | 1 Ream Case - 500 Sheets| 92 Bright | FSC Certified | 200060
HP Printer Paper | 8.5 x 11 Paper | Copy &Print 20 lb | 1 Ream Case - 500 Sheets| 92 Bright | FSC Certified | 200060
Sheet size – 8.5 x 11; Thickness – 20 pounds; Brightness – 92 bright white
$6.97
Bestseller No. 3
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 3 Reams (1,500 Sheets), 92 Bright White for Home Use
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 3 Reams (1,500 Sheets), 92 Bright White for Home Use
Virgin copy paper providing professional quality results; acid-free to prevent yellowing
$23.99
Bestseller No. 4
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 5 Reams (2,500 Sheets), 92 Bright White
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 5 Reams (2,500 Sheets), 92 Bright White
Virgin copy paper providing professional quality results; acid-free to prevent yellowing
$34.85
SaleBestseller No. 5
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 8 Reams (4,000 Sheets), 92 Bright White, Great for Crisp Ink Printing
Amazon Basics Multipurpose Copy Printer Paper, 20 lb, 8.5 x 11 Inches, 8 Reams (4,000 Sheets), 92 Bright White, Great for Crisp Ink Printing
Virgin copy paper providing professional quality results; acid-free to prevent yellowing
$49.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.