Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ CSS Print - Content and Footer overlap

Posted by: CharlesEF Mar 21 2018, 04:05 PM

Hi All,

I have made a sample page for another post I made on MSDN. Seems IE and Edge will only print 1 page when they should print 2 pages.

The sample page has the footer hidden. What I have tried to do is move the bottom of the content up the page so I can show the footer. The header section is red, the menu section is yellow, the content section has no background color (white) and the footer section is blue. When you print preview you might not see the colors, unless you have background colors enabled. The best solution would be to make the footer print at the very end (in other words print footer on page 2) but my research suggests that can't be done. Even the CSS @page footer will not work in my case. The sample page is http://www.cef-inc.com/css_print.html.

If anyone has an idea of the IE and Edge printing problem please post here also.

Also, if anyone with different browsers can test the page to make sure they see 2 pages that would be great. Please report any browsers that don't show 2 pages.



Thanks for any and all help,

Charles

Posted by: pandy Mar 21 2018, 05:14 PM

You want the footer to print? But it's set to display: none in the print CSS... unsure.gif


Posted by: pandy Mar 21 2018, 05:19 PM

Sorry! Me stoopid. I get it now.

I'm not good at print. But I'll ponder.

Posted by: CharlesEF Mar 21 2018, 08:39 PM

The problem is trying to figure out the bottom margin of the content section. I tried using CSS 'bottom' and 'height' but no value I tried in 'bottom' made a difference. The only value that made a difference (but causes a side effect) for 'height' was 100% but that only affected IE and Edge, they both now print 2 pages. The side effect is that all single page forms now print with a blank 2nd page. So, I may be stuck leaving the footer hidden.

Posted by: pandy Mar 22 2018, 02:16 AM

Make #content position: static in the print style sheet.

Posted by: CharlesEF Mar 22 2018, 09:58 AM

I tried that, it made no difference. Well, it did make a difference but not in a good way. With position: static; the first couple of fields on each page was missing.

Posted by: pandy Mar 22 2018, 03:07 PM

Yeah, you must also give #content enough top margin to go free from the header and menu since they are positioned. I should have said.

Posted by: CharlesEF Mar 22 2018, 05:08 PM

What I did was change the position of the #header, #menu and #content to static. By doing it that way I did not need to set the top margin in the #content at all. This fixed the multiple page printing problem in IE and Edge. But, now all my single page forms print with a blank 2nd page.

Posted by: pandy Mar 23 2018, 04:01 AM

I don't understand. Then how did it fix the problem?

Posted by: CharlesEF Mar 23 2018, 11:32 AM

IE and Edge now print multiple pages but I found that my single page forms now print with a blank 2nd page. I thought it fixed my IE and Edge multiple page printing problem not the problem I posted about here.

Posted by: pandy Mar 23 2018, 03:47 PM

Do it only on the concerned page then.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)