Take the 2-minute tour ×

I have written some stylesheets - including a print.css - and it's working fine.

I'd like to remove the URL from printing out on each of the pages. I am beginning to wonder if it is impossible. Is there an element/option that I can set to display:none to do this?

The reason is that the specific pages that have a 'normal' and 'print' stylesheet have been specially formatted so when printed, it forms a meaningful booklet. Therefore the URL is irrelevant.

share|improve this question
Thanks for the replies - I'll stop wasting my time! will also try to make the URLs a bit more meaningful too - rather than long strings and lots of version numbers! - Best regards, Mark –  Mark Feb 5 '10 at 11:17
really there needs to be styles that browsers can inspect/respect and determine if the header or footer should be present and possibly what content each should display. in the modern world of evergreen browsers I'm not certain how the industry can go this long (5-10 years depending on where you look) without this being addressed by W3 (to the point people simply give up) –  Shaun Wilson Aug 18 at 19:50

9 Answers 9

Sadly, no. The header and footer are generated by the browser. Only the end-user can change the footer - it might be an idea to give the user a step-by-step for each browser what to do. See for example here for a set of illustrated walk-throughs for windows based browsers.

The only alternative I know of is generating PDFs, with which you have full control over the printed output.

share|improve this answer
Thanks for the reply - I'll stop wasting my time! will also try to make the URLs a bit more meaningful too - rather than long strings and lots of version numbers! - Best regards, Mark –  Mark Feb 3 '10 at 15:08
I guess nothing has happened to this during the past two years? –  Kimble May 22 '12 at 7:27
@Kimble I don't think so, no. –  Pekka 웃 May 22 '12 at 8:07
this is and has always been the "open, portability" problem with the web, even with a nice rich set of standards there are still things millions of people want which no "open working group" is really addressing, and so every browser is doing something nobody much wants. if every browser does this (1. prints 2. optionally includes browser-specific header/footer), why is there no standard/spec for controlling the behavior? –  Shaun Wilson Aug 18 at 19:43

In Firefox, https://bug743252.bugzilla.mozilla.org/attachment.cgi?id=714383 (view page source :: tag HTML).

In your code, replace <html> with <html moznomarginboxes mozdisallowselectionprint>.

In others browsers, I don't know, but you can view http://www.mintprintables.com/print-tips/header-footer-windows/

share|improve this answer
It's worth it to mention that the <!DOCTYPE html> must be specified. It works on Chrome as well. But you have to use "system dialog" for it to work. –  Peter Nov 5 at 12:43

The headers and footers for printing from browsers is, sadly, a browser preference, not a document-level element that you can style. Refer to my very similar question for further workarounds and disappointment.

share|improve this answer

If I understand you correctly, you talk about the page headers and footers. They are printed by the browser. They are not part of your HTML content, so you can't influence them directly.

Show your users how to disable headers and footers in the «Page setup...» dialog.

share|improve this answer

This solution will do the trick in Chrome and Opera by setting margin to 0 in a css @page directive. It will not (currently) work for other browsers though...

share|improve this answer

It depends on your web browser. If you're using Firefox you can adjust or turn off those header and footer lines (URL, page number, etc) by going into File > Page Setup then clicking the Margins & Header/Footer tab.

share|improve this answer
He means doing it from the CSS via a print stylesheet. He would have to include your steps to all visitors. –  Anthony Feb 3 '10 at 15:06
Yeah, I realise that. The answer is no, you can't do it via CSS, it's specific to the browser. –  Simon Whitaker Feb 4 '10 at 23:32

I assume that you are talking about the URL that shows in the footer of the page.

If so, this is set by the browser and it is not something that you can do from your code.

share|improve this answer

I am not sure but the URL is added by a browser when you want to print. It is not part of the page so can not be affected by CSS. Maybe there is a way but it will be browser dependent.

share|improve this answer

For Internet Explorer, go to Tools. Click on the print option and then page set up. Under headers and Footer, make all the choices "empty". Then it will not print out on your printed pages.

I hope this helps.

share|improve this answer

Your Answer


