Using the Page-break-after property in CSS to implement Web page forced pagination printing

Source: Internet
Author: User
Although dedecms.com to introduce a lot of CSS properties related knowledge, but some very unpopular properties are still deficient. In the B/S program, the control of the printed page, CSS is relatively weak, for example: automatic paging, basically no practical use. We usually need to force the browser to page out when we need it, and we can use the following styles:

Sample code

[Www.dedecms.com]<style type= "Text/css" >. W3cbbs {page-break-after:always;} </style>

Auto: Has no effect on page segmentation.
Always: Forces the page break to appear after the element.
Avoid: Avoid page breaks after elements.
Left: Inserts a page break after the element until it reaches a blank, open page edge.
Right: Insert a page break after the element until it reaches a blank, left-side page.
Inherit: Uses the same property value as the parent element.

When Web pages are printed, labels can be inserted where paging is required

Sample code

[Www.dedecms.com]<p class= "W3cbbs" ></P>

Or

<p class= "W3cbbs" ></p>


Can!
But in use, may encounter the IE can be normal paging, but Firefox has no effect. The analysis found that when using the Page-break-after property in Firefox, it was not possible to place all of the printed content in a single table. This means that Firefox cannot break the table. So in Firefox use Page-break-after for page printing, to avoid placing the printed content in a table, the alternative method can put the content in a p.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.