Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of CSS @page rule</title> <style> @page { margin: 2in; /* default for all pages */ } @page :left { margin: 1in; /* margin on left page */ } @page :right { margin: 3in; /* margin on right page */ } @page :first { margin-top: 5in; /* top margin on first page */ } </style> </head> <body> <h1>CSS Page At-rule</h1> <p>If you open output in a new window and print (or print preview) the page the margin around the text content appears differently than it appears on the screen.</p> <p><strong>Warning:</strong> The @page rule do not supported by Firefox.</p> </body> </html>