In the previous course, the editor introduced many commonly used cssproperties. Today I want to change the route and introduce to you a relatively unpopular attribute - page-break-after. Although the usage rate of this attribute is quite low, it may be useful to you under certain circumstances. Help!
The page-break-after attribute is quite unfamiliar to many CSS learners. The editor also saw this attribute by chance. This attribute is mainly used to control the printing page in the B/S program. But in practice, CSS has relatively poor control capabilities in this area. For example, automatic pagination has basically no practical use. We usually need to force the browser to paginate when needed.
Having said that, let’s first take a look at the attribute values of page-break-after and their uses! Its attribute values include: auto, always, avoid, left, right and inherit.
Auto: Has no effect on page splitting.
Always: Force the page separator to appear after the element.
Avoid: Avoid page separators appearing after elements.
Left: Inserts a page break after the element until it reaches a blank left margin.
Right: Inserts a page break after the element until it reaches a blank right margin.
Inherit: Use the same attribute value as the parent element.
After understanding its attribute values, if we want to print pages on the web, we can just insert tags where page breaks are needed.
For example:
The above is the detailed content of Briefly introduce the use of page-break-after attribute. For more information, please follow other related articles on the PHP Chinese website!