{"id":18136,"date":"2013-09-16T21:01:09","date_gmt":"2013-09-16T13:01:09","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=18136"},"modified":"2025-04-04T01:37:27","modified_gmt":"2025-04-03T17:37:27","slug":"css3-page-break","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/","title":{"rendered":"How to Use CSS3 Page Breaks to Organize Printed Web Pages"},"content":{"rendered":"<p>While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It\u2019s possible that some of your users will print out your content to read offline.<\/p>\n<p>The ability to style content specifically for print has been around for years. This can be achieved using the <code>@media<\/code> rule within your stylesheet, like so:<\/p>\n<pre>\r\n@media print {\r\n  \/* Style rules *\/\r\n}\r\n<\/pre>\n<p>There are several properties that allow us to format web content for print, and today we\u2019ll focus on one of them: <strong>Page Break<\/strong>.<\/p>\n<h2>What Does It Do?<\/h2>\n<p>If you\u2019ve used word processors like Microsoft Word or Pages, you\u2019re likely familiar with the <strong>Page Break<\/strong> feature, which lets you move content to the next page.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg\" width=\"500\" height=\"300\" alt=\"Example of page break in Microsoft Word\"><\/figure>\n<p>The CSS Page Break feature does the same thing \u2013 allowing you to control how your web content is split across pages when printed.<\/p>\n<h2>Using Page Break<\/h2>\n<p>For demonstration, let\u2019s consider a sample page that I intend to print. Initially, there is an awkward break, as shown below.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/unwanted-break.jpg\" width=\"500\" height=\"300\" alt=\"Example of an unwanted page break\"><\/figure>\n<p>It would be better if the heading and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Widows_and_orphans\">orphan text<\/a> started on the next page.<\/p>\n<p>To achieve this, you can use the <code>page-break-after<\/code> property and set its value to <code>always<\/code>, forcing the next element to \u201cbreak\u201d onto the following page.<\/p>\n<pre>\r\n.page-break {\r\n  page-break-after: always;\r\n}\r\n<\/pre>\n<p>You can then either create a new element with this class between the elements or apply the class to the preceding element, like so:<\/p>\n<pre>\r\n&lt;p class=\"page-break\"&gt;With the &lt;strong&gt;Eraser&lt;\/strong&gt; feature, you can take composites of a photo, then put them together to get the background without the extras you don't want. &lt;\/p&gt;\r\n\r\n&lt;h3&gt;The phone to travel with&lt;\/h3&gt;\r\n&lt;p&gt;&lt;strong&gt;S Translator&lt;\/strong&gt; is going to be a great tool for your travels as...&lt;\/p&gt;\r\n<\/pre>\n<p>Now, the heading and the orphaned text should appear on the next page.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/to-the-next-page.jpg\" width=\"500\" height=\"300\" alt=\"Page break example with corrected placement\"><\/figure>\n<h2>Widows and Orphans<\/h2>\n<p>The method above can be tedious for large amounts of content. Instead of manually forcing page breaks, it\u2019s more efficient to set a minimum threshold for <strong>widows<\/strong> and <strong>orphans<\/strong>.<\/p>\n<p>In typography, widows and orphans are terms used to describe words or short lines left behind on a different page than the rest of the paragraph.<\/p>\n<p>By using the <code>orphans<\/code> and <code>widows<\/code> properties, you can specify a minimum threshold. For example, the following code ensures at least three lines remain at the bottom or top of paragraphs where page breaks occur:<\/p>\n<pre>\r\np {\r\n  orphans: 3;\r\n  widows: 3;\r\n}\r\n<\/pre>\n<h2>Further Resources<\/h2>\n<p>We\u2019ve covered the basics of controlling page breaks in printed media for your web content. Considering print styles in your website\u2019s design ensures your content looks good both on screen and on paper.<\/p>\n<p>For more detailed information, you can refer to the following resource:<\/p>\n<ul>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/2013\/WD-css3-page-20130314\/\">CSS Paged Media Module Level 3<\/a> \u2014 W3C<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It\u2019s possible that some of your users will print out your content to read offline. The ability to style content specifically for print has been around for years. This can be achieved&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[507,506,2016],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use CSS3 Page Breaks to Organize Printed Web Pages - Hongkiat<\/title>\n<meta name=\"description\" content=\"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It&#039;s possible\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use CSS3 Page Breaks to Organize Printed Web Pages\" \/>\n<meta property=\"og:description\" content=\"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It&#039;s possible\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-16T13:01:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:37:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Use CSS3 Page Breaks to Organize Printed Web Pages\",\"datePublished\":\"2013-09-16T13:01:09+00:00\",\"dateModified\":\"2025-04-03T17:37:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/\"},\"wordCount\":396,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-page-break\\\/page-break-word.jpg\",\"keywords\":[\"CSS\",\"HTML\",\"HTML5 \\\/ CSS3 Tutorials\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/\",\"name\":\"How to Use CSS3 Page Breaks to Organize Printed Web Pages - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-page-break\\\/page-break-word.jpg\",\"datePublished\":\"2013-09-16T13:01:09+00:00\",\"dateModified\":\"2025-04-03T17:37:27+00:00\",\"description\":\"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It's possible\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-page-break\\\/page-break-word.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-page-break\\\/page-break-word.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-page-break\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use CSS3 Page Breaks to Organize Printed Web Pages\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use CSS3 Page Breaks to Organize Printed Web Pages - Hongkiat","description":"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It's possible","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/","og_locale":"en_US","og_type":"article","og_title":"How to Use CSS3 Page Breaks to Organize Printed Web Pages","og_description":"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It's possible","og_url":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2013-09-16T13:01:09+00:00","article_modified_time":"2025-04-03T17:37:27+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Use CSS3 Page Breaks to Organize Printed Web Pages","datePublished":"2013-09-16T13:01:09+00:00","dateModified":"2025-04-03T17:37:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/"},"wordCount":396,"commentCount":10,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg","keywords":["CSS","HTML","HTML5 \/ CSS3 Tutorials"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/","url":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/","name":"How to Use CSS3 Page Breaks to Organize Printed Web Pages - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg","datePublished":"2013-09-16T13:01:09+00:00","dateModified":"2025-04-03T17:37:27+00:00","description":"While we live in a digital era where most content is easily accessible online, many people still prefer reading long-form text on paper. It's possible","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css3-page-break\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-page-break\/page-break-word.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css3-page-break\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use CSS3 Page Breaks to Organize Printed Web Pages"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4Iw","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=18136"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18136\/revisions"}],"predecessor-version":[{"id":73626,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18136\/revisions\/73626"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=18136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=18136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=18136"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=18136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}