MozillaZine

position static causes extra blank page in print

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

Post Posted March 25th, 2018, 8:33 pm

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: 146
Joined: November 21st, 2003, 4:56 am
Location: Edinburg, Texas

Post Posted March 27th, 2018, 6:12 pm

Anyone?

Lnwdz
 
Posts: 164
Joined: June 12th, 2012, 7:59 am

Post Posted March 28th, 2018, 1:46 am

Edit: Was irrelevant to actual problem
Last edited by Lnwdz on March 28th, 2018, 9:43 am, edited 1 time in total.

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

Post Posted March 28th, 2018, 8:42 am

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: 2716
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 28th, 2018, 9:48 am

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.

DanRaisch
Moderator

User avatar
 
Posts: 119765
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted March 28th, 2018, 11:30 am

Moving to Web Development per request.

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

Post Posted March 28th, 2018, 6:04 pm

Thank you,

Charles

Frenzie

User avatar
 
Posts: 2134
Joined: May 5th, 2004, 10:40 am
Location: Belgium

Post Posted March 30th, 2018, 2:55 am

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.

jscher2000

User avatar
 
Posts: 10132
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted March 31st, 2018, 8:40 am

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%.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 2 guests