I have a @media print{}
section to tweak a site for printing. I'm forcing a page break before main blocks. However, elements overlap in Firefox (other browsers render everything as expected). As the following print preview illustrates, red block displays on top or previous content rather than jumping to page 3:
HTML structure is like this:
<div class="cols">
<div class="col col1de2">This is the yellow block</div>
<div class="col col2de2">This is the blue block</div>
</div>
<div class="extra">This is the red block</div>
... and this is the relevant CSS:
.cols{
overflow: hidden;
}
.col{
float: left;
width: 40%;
}
.extra{
page-break-before: always;
clear: both; /* Attempted workaround: didn't work */
}
You can see in it action though you need to print JSFiddle's Result frame (possibly to a PDF printer—not sure about how to trigger Print Preview menu item in a frame).
Can you figure out a fix or workaround?