27 May 2010

Firefox printing woes

So I was working on a webpage that included alot of generated content (aka content were I could not control the length) and firefox kept putting the page breaks in the middle of content instead of just before or just after. I tried implementing page-break-before: avoid; inside of the paragraph. I also tired page-break-inside: avoid;. However, both were to no avail.

The all at once it hit me! I was using floats to do the page layout with my divs! So I just switched from float:left; to display:inline-block; Then with a couple other minor changes to widths, Firefox was correctly inserting page breaks!