property
Page — CSS reference
Associates a box with a named page style. A change in used page name between applicable boxes can force a page break. auto uses the page naming rules for the surrounding context. Here a second section uses a wider page without an explicit break declaration.
Formal Syntax & Structure
css syntaxcss
@page wide { size: 400px 300px; } .wide { page: wide; }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>page</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}p{margin:0;font:12px/16px sans-serif}.next{break-before:page}@page{size:300px 400px;margin:40px;}@page wide{size:400px 300px} .wide{page:wide}</style><body><main><p>ONE</p><p class="wide">TWO</p></main></body></html>