Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Thursday, May 5, 2016

Can I remove the URL from my print css, so the web address doesn't print?

Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Pekka ? for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Beat Bolli for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Mitchel Sellers for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Rusty Horse for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Simon Whitaker for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by Anthony for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by awe for Can I remove the URL from my print css, so the web address doesn't print?


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...

Answer by Jeanne Wise for Can I remove the URL from my print css, so the web address doesn't print?


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.

Answer by user3886203 for Can I remove the URL from my print css, so the web address doesn't print?


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

In your code, replace with .

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

Answer by mtchuente for Can I remove the URL from my print css, so the web address doesn't print?


you can try this in the stylesheet:

@page{size:auto; margin-bottom:5mm;}  

But this also removes the page number

Answer by Muhammad Fahad for Can I remove the URL from my print css, so the web address doesn't print?


use that code.that will help

@media print   {    @page { margin: 0; }    body  { margin: 1.6cm; }  }  

Answer by Darshan Kathiriya for Can I remove the URL from my print css, so the web address doesn't print?


@media print { a[href]:after { content: none !important; } img[src]:after { content: none !important; } }


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.