Print HTML page without additional content (URL, date, etc)
css, html, javascript, php
Solution
The URL, date, and page title, and other information that are often printed in the header and/or footer are controlled by the web browser. Unfortunately, you cannot control these via CSS or HTML. It is up to the visitor of your site to decide whether or not they want these elements to print.
Users can turn off headers and footers by following the steps below. (Steps may vary based on browser version, or may even be unavailable on older browsers. All steps done in the latest version of each browser.)
Chrome
- Click the icon in the top right corner of the browser.
- Click Print.
- Uncheck Headers and Footers under the Options section.
Firefox
- Click in the top left corner of the browser.
- Place your mouse over Print, the click Page Setup.
- Click the Margins & Header/Footer tab.
- Change each value under Headers & Footers to `--blank--`.
Internet Explorer
- Click the icon in the top right corner of the browser.
- Place your mouse over Print, then click Page Setup.
- Change each value under Headers and Footers to `-Empty-`.
Problem
I want to print an HTML page the way it is, without any additional content such as URL and date. Some people told me that you cannot do it using CSS/JavaScript because those additional stuff are from the browser/printer. The user who will print the page is using the server machine. The browser will be the interface and PHP can be used in conjunction to print. What would be the best way to do it?