Edit online

Unexpected Page Break Before or After an Element

Problem

A page break occurs before or after an element that has page-break-before or page-break-after (break-before or break-after) property set to avoid. For example, after a topic/section title (set by default):
*[class ~= "topic/title"] {
  page-break-after: avoid;
}

Cause

An empty element (for example, <p> or <shortdesc>) is present before or after the element with the break set to avoid. The page-break actually occurs at this element level.

Solution

Either remove the empty element from the DITA source topic (preferable) or set the display to none using the following CSS rule:
*[class ~= "topic/shortdesc"]:empty {
  display: none;
}