Linens
Linens

Reputation: 7942

html page break adds 3 extra blank pages

When I use the page break attribute and then look at my page from i.e7 and click print preview, it generates 3 blank pages between the first and second page.

I have copied some sample code here: http://jsfiddle.net/vW54X/embedded/result/

You can't really replicate the error though because its embedded as an iframe

Upvotes: 1

Views: 4980

Answers (3)

Miguel Stevens
Miguel Stevens

Reputation: 9230

The solution is to give your body a height: auto;.

Upvotes: 1

user6269864
user6269864

Reputation:

When I had a similar problem, I resolved it by setting the maximum height of each of my <div>s to a very small amount and gradually increasing it until the problem appeared again.

Basically, just this:

.your-container-div {
    max-height: 27.4cm;
}

Upvotes: 0

Jason Gennaro
Jason Gennaro

Reputation: 34863

IE7 does funny things with page-break-after:always.

Instead of applying it to your div#cl, create a new, empty p or div and apply it to that. Place that after the #cl, so

<div id-"cl">
    //all your content
</div>

<div class="pageBreak">&nbsp;</div>

Style it with page-break-after: always but hide it until print.

Upvotes: 1

Related Questions