Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM | Style pageBreakInside Property

Improve Article
Save Article
  • Last Updated : 05 Jun, 2022
Improve Article
Save Article

The Style pageBreakInside property is used for setting or returning the page-break behavior inside an element in printing or print preview. The Style pageBreakInside property does not affect the absolutely positioned elements. 

Syntax :

  • To get the property:
  • To set the property: = "auto|avoid|initial|inherit"

Note: Instead of this property use break-inside property because it is replaced with break-inside property

Return Values: It returns a string value, which represents the page-break behavior inside an element when printing

Property Values :

  • auto: It is used to insert a page break inside the element if necessary.
  • avoid : It is used to avoid a page break inside an element.
  • initial : It is used to set this property to its default value.
  • inherit : It is used to inherit this property from its parent element.

Below program illustrates the Style pageBreakInside property : 

Example: Avoiding a page break inside the <p> element with id=”footer” 


<!DOCTYPE html>
    <title>Style pageBreakInside Property in HTML</title>
        h1 {
            color: green;
        h2 {
            font-family: Impact;
        body {
            text-align: center;
    <h2>Style pageBreakInside Property</h2>
    <p id="myfooter">Geeksforgeeks is a portal for geeks.</p>
    <p>For avoiding page break inside footer paragraph,
      double click the "Avoid Page Break" button: </p>
    <button ondblclick="pagebreak()">Avoid Page Break</button>
        function pagebreak() {
            .style.pageBreakInside = "avoid";


  • Before Clicking the button:
  • After clicking the button:

Note: In order to see the output, please save the code in HTML file and run it on your browser. The output will be seen when you will see the PRINT PREVIEW of that file. 

Supported Browsers: The browser supported by HTML DOM | Style pageBreakInside Property are listed below:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Internet Explorer 8 and above
  • Firefox 19 and above
  • Opera 7 and above
  • Apple Safari 1.3 and above

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!