page-break-before and page-break-after CSSproperties will not modify the display of the web page on the screen. These two properties are Used to control how files are printed. Each printing attribute can be set to 4 setting values: auto, always, left and right. Among them, Auto is the default value. You only need to set the page break symbol (Page breaks) when necessary. If page-break-before is set to always, the printer will restart a new printing page when encountering a specific component. If page-break-before is set to left, page break symbols will be inserted until the specified component appears on a left blank page. If page-break-before is set to right, page break symbols will be inserted until the specified component appears on a blank page on the right. The page-break-after attribute will add the page break symbol after the specified component, not before. In the following
program you will be able to see the settings of these properties,
<HTML> <HEAD> <TITLE>Listing 14-4</TITLE> </HEAD> <BODY> <DIV>This is the first DIV.</DIV> <DIV STYLE="page-break-before:always">This is the second DIV.</DIV> <DIV STYLE="page-break-after:always">This is the third DIV.</DIV> <DIV>This is the fourth DIV.</DIV> <DIV STYLE="page-break-before:right">This is the fifth DIV.</DIV> <DIV STYLE="page-break-after:right">This is the sixth DIV.</DIV> <DIV>This is the last DIV.</DIV> </BODY> </HTML>
Available values
The above is the detailed content of Detailed explanation of paging printing using page-break-before and page-break-after in css. For more information, please follow other related articles on the PHP Chinese website!