Shade box page break padding

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
Leighb
Posts: 6
Joined: Tue Apr 08, 2025 7:32 pm

Shade box page break padding

Post by Leighb »

I am using Oxygen 27.1 and Chemistry 27.1. I have some content in a div that is styled to have a gray background. Sometimes that content with the gray background is too long for one page and rolls over to a new page. The break at the bottom of the first page leaves the content too tight to the bottom edge of the gray box and the content on the next page leaves the content too close to the top of the gray box. How can I add padding to the content break for this naturally occurring page break so the gray box isn't so tight to the text?
2025-08-25_16-48-00.png
Thanks,
Leigh
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 707
Joined: Wed Oct 16, 2019 3:47 pm

Re: Shade box page break padding

Post by julien_lacour »

Hello Leigh,

Unfortunately, CSS does not provide a way to apply padding/margin inside an element split by a page break.
If you are using DITA and the DITA Map PDF - based on HTML5 & CSS scenario, as a workaround you could mark the split paragraph with @outputclass="page-break-avoid" so it will be move into the next page, then change the default paragraphs margins in padding:

Code: Select all

*[class ~= "topic/p"] {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 1em;
  padding-bottom: 0.5em;
}
For more information about force page-breaks you can check our user guide.

Regards,
Julien
Leighb
Posts: 6
Joined: Tue Apr 08, 2025 7:32 pm

Re: Shade box page break padding

Post by Leighb »

Thanks Julien. That works!
Leigh
Post Reply