htmlcsssalesforcevisualforceuser-generated-content

Can I set CSS to put a whole <p> on a single page (generated content in SalesForce)?


I'm working in SalesForce. I have a page that generates a PDF based on user specified paramaters. The trouble is that most sometimes the <p> run between pages and it looks terrible.

Is there a way (using CSS or HTML) to force a page break if the <p> will run between pages?


Solution

  • page-break = <div style="page-break-after:always;"></div>

    Not breakable area = <div style="page-break-inside:avoid"> Not breakable html area </div>