If construction Hypertext Markup Language page for present on Internet or company intranet using Internet Explorer, you might not be worried with how file looks when it printed. However, users who need to print page to moveable Document Format will understand it if insert code that enables suitable page breaks when printing to PDF. To insert page break, use Cascading Style Sheet "page-break before attribute" in code. By using CSS media type of "print," you don't have to create different versions of page depending on whether your user views in on screen or prints it.
• Open HTML file in standard text editor so that you put in extra code to page.
• To make page break before each first level title, for ex. specify the "page-break-before attribute" to "h1" as shown below:
<html>
<head>
<style>
@media print
{
h1 {page-break-before: always}
}
</style>
</head>
<body>
<p>This is an example.</p>
</body>
</html>
• Save file. Print file to PDF, for ex. using Acrobat Pro to ensure the page break occurs where you want it.



Reply With Quote
Bookmarks