Reputation: 431
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
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
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
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
Reputation: 5604
I don't think you can. Support for page-break-after
is limited.
Upvotes: 0