By default, when you print a web page, the page title and and URL are printed at the top of the page, and likewise the date and time are printed at the bottom.
It is possible to remove this additional as you are printing through the PAGE SETUP menu (under FILE in Internet Exp)
Does anyone know of a way of doing this via CSS or javascript?
This question is related to
javascript
html
css
completing Kai Noack's answer, I would do this:
var originalTitle = document.title;
document.title = "Print page title";
window.print();
document.title = originalTitle;
this way once you print page, This will return to have its original title.
Try this;
@media print{ @page { margin-top: 30px; margin-bottom: 30px;}}
You can add this in your stylesheet: @page{size:auto; margin:5mm;}
But this discards the page number too
Its simple. Just use css.
<style>
@page { size: auto; margin: 0mm; }
</style>
A possible workaround for the page title:
document.title = "Print page title"; window.print();
This should work in every browser.
There's a facility to have a separate style sheet for print, using
<link type="text/css" rel="stylesheet" media="print" href="print.css">
I don't know if it does what you want though.
Source: Stackoverflow.com