Sharath B. Patel
Sharath B. Patel

Reputation: 431

Page-break-after:always is being ignored by the browsers

I am mailing a HTML page as attachment.

I have used <div style="page-break-after:always;> </div> 2 times here and there.

It is supposed to be 3 pages, but the browser ignores the page breaks and removes all the empty space of the page and it's giving 2 pages after printing.

The code is working fine with ThunderBird, the problem is with browsers.

How do I enforce this page break?

Upvotes: 2

Views: 1423

Answers (4)

Sablednah
Sablednah

Reputation: 11

Sorry to raise a dead thread - but I found this during a search

Did you use

<div style="page-break-after:always;> </div>

exactly?

if so try putting in the closing "

<div style="page-break-after:always;"> </div>

as of now (may 2013) page-break-after:always; is supported well - but IE 10 does have some issues.

Upvotes: 1

Xavi L&#243;pez
Xavi L&#243;pez

Reputation: 27880

I don't think it's possible to display page breaks on a browser. As far as I know, browsers don't support paged media, and therefore ignore that kind of elements (including carriage returns).

In a print preview, for instance, pagination should be displaying correctly.

Upvotes: 2

Doug Stephen
Doug Stephen

Reputation: 7351

Page breaks were introduced in CSS2 as a way of managing printed content, not content for the screen. This style tells your browser how to send web content to the printer. Browsers don't auto-paginate.

Edited for redundancy

Upvotes: 2

John Keyes
John Keyes

Reputation: 5604

I don't think you can. Support for page-break-after is limited.

Upvotes: 0

Related Questions