CSS Page-Break-Inside:avoid (or similar method) to format breaks

193 views Asked by At

I'm having trouble employing page-break-inside:avoid for my print CSS.

Searching around for solutions, I've read it's good practice to set float:none, display:block, and position:relative for the target and parent elements, but I haven't had any luck getting it to work in Safari or Chrome, which supposedly no longer have support issues.

In this case, I want to avoid images spanning a page break. They are each contained in div.scrollingSSImage

All of my CSS validates fine. What else am I screwing up?!

Thank you ––Michael Femia

@media print{
        div.nav{display:none;}
        div.scrollingSSImage,div.scrollingSSImage > img{
            position:relative;
            float:none;
            page-break-before:auto; 
            page-break-after:auto; 
            page-break-inside:avoid;
        }
}
0

There are 0 answers