How to Remove the Url from My Print Css, So the Web Address Doesn't Print

How to remove url from print(in browser)

I did this and both the problems got solved.

    @page 
{

size: auto; /* auto is the current printer page size */
margin: 0mm; /* this affects the margin in the printer settings */
}

@media print {
#print {
display : none;
}
}

Removing elements that appear when printing, using print.css stylesheet

There are quite a few posts on the subject here on StackOverflow:

  • Remove header and footer from
    window.print()
  • Removing page title and date when printing web page (with
    CSS?)
  • Can I remove the URL from my print css, so the web address doesn't
    print?
  • How to remove the URL from the printing
    page?
  • Disabling browser print options (headers, footers, margins) from
    page?

Looks like it works by using the @page media property in combination with the print media property:

@media print {
@page { margin: 0; }
}

However, it only seems to work in Chrome (for the moment). Firefox can be made to oblige, though. Elsewhere, it was suggested to create PDF on the fly - or to use JavaScript to set at least the page title to an empty string.

Also, I'd question why you'd want to hide something your users are usually used to have control over.

To answer your question, though: The LA Times use bootstrap, which sets the page margin as follows:

...@page{margin:.5cm}...

Print a website without printing the link locations?

Seems you are printing a page with this styling from a CSS2 compliant browser

http://www.alistapart.com/articles/goingtoprint/

In a fully CSS2-conformant browser, we
can parenthetically insert the URLs of
the links after each one, thus making
them fairly useful to anyone who has a
copy of the printout and a web browser
handy. Here’s the rule, which
restricts this effect to the “content”
div and thus avoids sticking a URL in
the masthead:

#content a:link:after, #content a:visited:after {    
content: " ("attr(href) ") ";
font-size: 90%;
}

Try it out in a Gecko-based browser,
like Mozilla or Netscape 6.x. After
every link in the printout, you should
see the URL of the link in
parentheses.

how to get rid of the url when printing html

I believe that's a browser by browser setting and can't be set through the page. I'd love it if someone could prove me wrong, though. :)

Remove links references from the Media Print Screen

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

Try to override your print media by the above code.



Related Topics



Leave a reply



Submit