Home  >  Article  >  Web Front-end  >  How to use css page-break-inside property

How to use css page-break-inside property

藏色散人
藏色散人Original
2019-05-30 10:55:483155browse

css page-break-inside attribute is used to set the page-breaking behavior inside the element. Although you can use always to force page breaks, there is no guarantee to avoid the insertion of page breaks. The most the creator can do is ask the user agent to try as much as possible Avoid inserting page breaks.

How to use css page-break-inside property

How to use the css page-break-inside attribute?

Function: The page-break-inside attribute sets the page inside the element -breaking behavior.

Note: Although you can use always to force page breaks, there is no guarantee that the insertion of page breaks will be avoided. The most the creator can do is ask the user agent to avoid inserting page breaks as much as possible. Applies to: non-floating block-level elements whose position value is relative or static.

Note: Only the Opera browser supports the page-break-inside attribute.

css page-break-inside property usage example

<html>
<head>
<style>
@media print
{
table {page-break-inside:avoid;}
}
</style>
</head>
<body>
....
</body>
</html>

Effect output:

How to use css page-break-inside property

The above is the detailed content of How to use css page-break-inside property. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn