Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <p>This is a test case for the <code>widows</code> and <code>orphans</code> CSS properties in Paged.js. Please see <a href="https://gitlab.pagedmedia.org/tools/pagedjs/issues/268">issue #268</a> for further details.</p>

<p>Proin efficitur, ipsum eu ullamcorper lobortis, mi urna placerat nisi, et maximus augue nunc quis lacus. Aliquam dui justo, imperdiet non leo semper, suscipit porttitor elit. Nulla facilisi. Aenean vitae fringilla sem, in aliquam lectus. Nunc euismod at est sit amet egestas.</p>

<p>Maecenas iaculis porta massa in facilisis. Quisque nec nisl sapien. Proin facilisis neque et diam luctus molestie. Cras pharetra cursus viverra.</p>

<p>Donec dapibus, nibh eu fringilla maximus, erat ligula sagittis lectus, at efficitur dui tortor a ipsum. Fusce tempor pulvinar odio, ut tincidunt nulla lobortis eget.</p>

<p>Suspendisse potenti. Vivamus sagittis posuere ipsum, convallis pellentesque dolor tincidunt et. Nullam sollicitudin dui vel sapien imperdiet euismod. Nullam imperdiet mauris ut felis rhoncus, sit amet interdum diam consequat. Sed finibus vel libero sit amet aliquam. Curabitur pharetra arcu est, ut hendrerit massa ultricies sed. Pellentesque sodales ligula est, pretium tempor eros pellentesque sit amet. Sed id sem aliquam, aliquet libero sit amet, molestie neque.</p>

<p><strong>I am an orphan line.</strong> Nullam vestibulum accumsan libero, sit amet pulvinar nulla ullamcorper eget. Nunc iaculis auctor tempus. Maecenas nec ante interdum, porttitor justo nec, venenatis augue. Nunc sit amet sodales libero. Praesent non vehicula leo. Nulla sodales urna pellentesque enim vestibulum pretium. Aliquam tristique libero non interdum molestie. Morbi id egestas arcu. Suspendisse vel dictum turpis. In accumsan venenatis tellus, id placerat ante dignissim sed. Curabitur convallis nulla sed euismod laoreet. Donec ac felis eget ante aliquet blandit et ac nisl. Proin quam lectus, finibus vel quam sed, iaculis finibus eros. Nunc eu condimentum felis.</p>

<p>Aenean eget leo et diam ullamcorper faucibus eu sit amet ante. Morbi malesuada non massa nec tempor. Donec vitae massa convallis diam vulputate fringilla vel ac elit. Etiam at rutrum elit, sit amet dignissim leo. Cras bibendum scelerisque felis, vel elementum nunc rhoncus ultricies. Vestibulum porttitor luctus orci ut venenatis. In hac habitasse platea dictumst. Proin ut varius turpis.</p>

<p>Quisque sollicitudin orci in lorem luctus rhoncus. Praesent sed malesuada urna. Proin viverra dolor quis nisi vestibulum volutpat. Curabitur iaculis velit tortor, et convallis urna efficitur id. Maecenas erat tortor, varius a nisi eu, accumsan elementum ex. Nunc volutpat ante est, vitae scelerisque ante tempor sed. Nunc risus urna, rhoncus vel odio at, mollis hendrerit neque. Vestibulum consequat, libero eu gravida tempor, ipsum leo commodo ipsum, ac bibendum nunc est at lacus. Phasellus at nisl sed nisl viverra <strong>I am a widow line</strong>.</p>
              
            
!

CSS

              
                @page {
  size: A5;
  margin: 3cm;
  font-family: 'EB Garamond', serif;
  font-size: 11pt;
  line-height: 1.35;
}

p {
  orphans: 3;
  widows: 3;
}




/** The standard `interface.css` follows **/

/* Change the look */
:root {
    --color-background: whitesmoke;
    --color-pageSheet: #cfcfcf;
    --color-pageBox: violet;
    --color-paper: white;
    --color-marginBox: transparent;
    --pagedjs-crop-color: #000;
    --pagedjs-crop-stroke: 1px;
}

.pagedjs_marks-crop{
    z-index: 999999999999;
}

/* To define how the book look on the screen: */
@media screen {
  body {
    background-color: var(--color-background);
  }

  .pagedjs_pages {
    display: flex;
    width: calc(var(--pagedjs-width) * 2);
    flex: 0;
    flex-wrap: wrap;
    margin: 0 auto;
  }

  .pagedjs_page {
    background-color: var(--color-paper);
    box-shadow: 0 0 0 1px var(--color-pageSheet);
    margin: 0;
    flex-shrink: 0;
    flex-grow: 0;
    margin-top: 10mm;
  }

  .pagedjs_first_page {
    margin-left: var(--pagedjs-width);
  }

  .pagedjs_page:last-of-type {
    margin-bottom: 10mm;
  }

  .pagedjs_pagebox{
    box-shadow: 0 0 0 1px var(--color-pageBox);
  }

  .pagedjs_left_page{
    z-index: 20;
    width: calc(var(--pagedjs-bleed-left) + var(--pagedjs-pagebox-width))!important;
  }

  .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-crop {
    border-color: transparent;
  }

  .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-middle{
    width: 0;
  }

  .pagedjs_right_page{
    z-index: 10;
    position: relative;
    left: calc(var(--pagedjs-bleed-left)*-1);
  }

  /* show the margin-box */

  .pagedjs_margin-top-left-corner-holder,
  .pagedjs_margin-top,
  .pagedjs_margin-top-left,
  .pagedjs_margin-top-center,
  .pagedjs_margin-top-right,
  .pagedjs_margin-top-right-corner-holder,
  .pagedjs_margin-bottom-left-corner-holder,
  .pagedjs_margin-bottom,
  .pagedjs_margin-bottom-left,
  .pagedjs_margin-bottom-center,
  .pagedjs_margin-bottom-right,
  .pagedjs_margin-bottom-right-corner-holder,
  .pagedjs_margin-right,
  .pagedjs_margin-right-top,
  .pagedjs_margin-right-middle,
  .pagedjs_margin-right-bottom,
  .pagedjs_margin-left,
  .pagedjs_margin-left-top,
  .pagedjs_margin-left-middle,
  .pagedjs_margin-left-bottom {
    box-shadow: 0 0 0 1px inset var(--color-marginBox);
  }

}

              
            
!

JS

              
                
              
            
!
999px

Console