Page Break Does Work With Alignment

Created on 19 August 2025, 13 days ago

Problem/Motivation

When images or videos have default alignment or are aligned left or right the page break does not work.

Steps to reproduce

1. Add content to page
2. Align content left or right or use default
3. Add page break
4. Page break doesn't appear to break.

Proposed resolution

I noted the css is using "page-break-after" and I know this is deprecated.

Remaining tasks

Determine the best method to clear content for the page break.

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇨🇦Canada Shane Birley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Shane Birley
  • 🇨🇦Canada Shane Birley

    In my mind, when a page break is applied, it should (basically) clear everything away on both left and right, much like in a word processor. I checked the CSS that is applied to the .page-break class and I don't feel it covers all scenarios when alignment is in play. For paragraphs, lists, and the like - it works fine.

    Anyway, after playing around with using CSS as the solution rather than messing with the module code, here is what I have come up with.

    1. First apply a clear to classes and floats used within CKeditor that have .page-break assigned whether or not is is a float, inline, etc.

    .align-left ~ .page-break,
    .align-right ~ .page-break,
    [class*="align-"] ~ .page-break,
    [style*="float:left"] ~ .page-break,
    [style*="float:right"] ~ .page-break {
      clear: both !important ;
      display: block !important ;
      margin-top: 0 !important ;
      margin-bottom: 0 !important ;
      padding: 0 !important ;
    }
    

    2. But also make sure to be faithful to making sure the .page-break class function works but doesn't add any padding or spacing to itself.

    .page-break {
      display: block !important ;
      clear: both !important ;
      margin: 0 !important ;
      padding: 0 !important ;
    }
    

    I am using "!important" here just to override the current configuration but I don't think it would be necessary for a modification to the module.

    I wonder if I am missing something within the config... but I don't think so. Thoughts? Questions?

  • Hi Shane

    According to CKE5 documentation, page break focuses on formatting content for printing or exporting to Word/PDF.

    If you'd like to use it to format your rendered content, the best way is to apply custom CSS on your site.

Production build 0.71.5 2024