I have a page that I need to add a header to, a footer, paper sizes as legal, etc and every other print formatting properties. Pleas how can I do this to a html page. I have completed the design and everything needed but i cant prepare it for printing as the client required. Thanks.
Create a separate style sheet for printing as opposed to screen display. Use this style sheet to control things like page margins, width of printable area, and other factors that only apply to the printed version. You could also use it to hide on-screen navigation and other items that you don't need on the printed page.
Then, in your HTML, select the style sheet, possibly using code similar to the following:
<link rel="stylesheet" type="text/css" href="screen.css" media = "screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
But keep in mind that with HTML you can't really control the layout of the printed page. You don't know what paper size the user has selected, what zoom factor they are applying to the printed version, what fonts they have installed, and several other factors. If you really want total control over the printed page, the best approach is to generate a PDF - but even that's not perfect.
This topic is now closed. New replies are no longer allowed.