简体   繁体   中英

CSS page-break properties

I am trying to use CSS page-break properties to avoid a page break after the title span. The html is as follows:

<div  class="cnx-eoc free-response">
  <div class="title">
    <span>Review Questions</span>
  </div>
</div>

The CSS rules I declared are below:

div.cnx-eoc.free-response > div.title { 
  page-break-inside: avoid; 
  page-break-after: avoid;
}

This solution should work, however I do not get the expected results. Any suggestions?

If I am not wrong, you are trying to use it on span . However, page-break-after CSS property applies to block-level elements. Reference: page-break-after .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM