position static causes extra blank page in print

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Locked
CharlesEF
Posts: 148
Joined: November 21st, 2003, 4:56 am
Location: Edinburg, Texas

position static causes extra blank page in print

Post by CharlesEF »

Hi All,

I have a sample page http://www.cef-inc.com/testing/ff_print.html. If you load this sample and then do a print preview you will see a blank last page. If you inspect the header element and remove '<h2>Xxxxx Yyyyy Zzzzz</h2>' then no more blank last page.

Is this by design? Is my 'fixed' layout page to blame?


Thanks for any help,

Charles
CharlesEF
Posts: 148
Joined: November 21st, 2003, 4:56 am
Location: Edinburg, Texas

Re: position static causes extra blank page in print

Post by CharlesEF »

Anyone?
Lnwdz
Posts: 173
Joined: June 12th, 2012, 7:59 am

Re: position static causes extra blank page in print

Post by Lnwdz »

Edit: Was irrelevant to actual problem
Last edited by Lnwdz on March 28th, 2018, 9:43 am, edited 1 time in total.
CharlesEF
Posts: 148
Joined: November 21st, 2003, 4:56 am
Location: Edinburg, Texas

Re: position static causes extra blank page in print

Post by CharlesEF »

I was hoping to not have to make adjustments, like you have shown. And yes, I tried 4 different browsers and they all do the extra blank page. Position: absolute works great in Firefox and Chrome but not IE 11 and Edge. The problem is that IE and Edge will only print 1 page of a multiple page form. I think MS has a bug but since I can't get past the trolls at MSDN I can't ask MS about it (they blame my fixed layout design. They suggest I fit into the 'box' by looking into frameworks and/or templates). Position: static solves the IE/Edge problem but causes the extra blank page.

Maybe this question should be moved to the web development forum?


Thanks for your input,

Charles
morat
Posts: 6394
Joined: February 3rd, 2009, 6:29 pm

Re: position static causes extra blank page in print

Post by morat »

See if anything in these threads are helpful in your case.

http://stackoverflow.com/questions/3697444
http://stackoverflow.com/questions/10902686
Last edited by morat on March 28th, 2018, 1:36 pm, edited 1 time in total.
User avatar
DanRaisch
Moderator
Posts: 127166
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: position static causes extra blank page in print

Post by DanRaisch »

Moving to Web Development per request.
CharlesEF
Posts: 148
Joined: November 21st, 2003, 4:56 am
Location: Edinburg, Texas

Re: position static causes extra blank page in print

Post by CharlesEF »

Thank you,

Charles
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: position static causes extra blank page in print

Post by Frenzie »

CharlesEF wrote:Is my 'fixed' layout page to blame?
This is a question that takes ten seconds to test, so it should not be up to anyone reading this. The answer is no.

You can either try to figure out where you're inserting extra pixels through margin, padding, borders, etc. or just stick something like this in your print styles:

Code: Select all

html, body {height:99%}
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
jscher2000
Posts: 11734
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: position static causes extra blank page in print

Post by jscher2000 »

Either of these will fix it by preventing top margin collapsing on the header -- the phenomenon of the top margin of the first element in a container poking out of the top of its containing element, which you can see by the position of the h2 within the header -- but I'm not sure why the second page is generated in the first place:

Code: Select all

#header {
  border-top: 1px solid red;
}

Code: Select all

#header {
  padding-top: 1px;
}
----

Actually, I think Frenzie has the answer: you have 100% height for the body. Somehow the margin-collapsing on the h2 is causing the page to exceed 100%.
Locked