Wednesday, November 18, 2009

fixed my content disappearing in Firefox print preview

Problem

You wrote a web page which the customer will want to print out, which takes 2 or more pages of paper to print. Everything works fine in IE6, but when you go to print it in Firefox, only the first page comes out! The rest of the web page is simply missing from the printer.

Solution

Do you ever get the feeling that these Problem/Solution tricks I write about are from my own experiences as a web developer? You bet! This one took me quite some time to figure out.

The problem was in the style settings of the container of the web page content.

I was using a DIV tag to surround the entire body of the text of the web page to be printed. That DIV tag referenced a CLASS within my CSS that happened to have the element:

overflow: auto;

Removing that little bit from the DIV tag's CSS class completely solved the problem.

I actually didn't need to remove it, and instead I changed the setting to visible.

http://www.fastechws.com/tricks/web/printing-web-page-has-missing-pages-in-firefox.php