Forum How do I...?

Lengthy element truncation (DIV)

seawolf
Hi,

Last time I posted the solution came to me within a halfhour, so did a response here, so hopefully this will happen again =)

I have a simple repeating set of DIVs for containing sections, inside which are a header and a body DIV. Sometimes the body rambles on a bit but doesn't span multiple pages but gets chopped off. The following page is another container, with header and body as expected.

I have attempted a
div { page-break-inside: auto!important; }
but without success. I assume it would work if I could take the heading and body out from their container DIV, but for many site operational reasons I can't.

Seeing
float: prince-top-if-necessary
gave me hope but the layout is no longer correctly stacked, it seems more work to use that and fix the rest.

Any ideas?
Many thanks in advance!
Nicholas
It sounds like some heights may be set as well. Try height: auto? If not, then it's a matter commenting out the entire style sheet and adding in rules bit by bit to see where the problem is. With no styles, Prince will split paginate the content correctly. I usually do an 'interval bisection' when I'm really stuck, using just the first half of my style sheet, then just the second half, then deleting bits in quarters, and so on.
mikeday
Right, it could be that the div has a fixed height, or is absolutely positioned, or floated maybe?
seawolf
Ah, applying
height: auto!important
did it.

Thanks lots!