Skip to content

Instantly share code, notes, and snippets.

@zhuangya
Created August 20, 2013 17:41
Show Gist options
  • Select an option

  • Save zhuangya/6284700 to your computer and use it in GitHub Desktop.

Select an option

Save zhuangya/6284700 to your computer and use it in GitHub Desktop.
break the page by css.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Page break test </title>
<link rel="stylesheet" media="all" href="./style.css">
</head>
<body>
<div class="page"> Page 1 </div>
<div class="page"> Page 2 </div>
</body>
</html>
@media print {
.page:after {
content: '\0020';
display: block;
page-break-before: always;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment