Need to remove href values when printing in Chrome

Chris Gratigny picture Chris Gratigny · Sep 4, 2011 · Viewed 134.3k times · Source

I'm attempting to customize the print CSS, and finding that it prints links out with the href value as well as the link.

This is in Chrome.

For this HTML:

<a href="http://www.google.com">Google</a>

It prints:

Google (http://www.google.com)

And I want it to print:

Google

Answer

Alex Ghiculescu picture Alex Ghiculescu · Feb 18, 2013

Bootstrap does the same thing (... as the selected answer below).

@media print {
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

Just remove it from there, or override it in your own print stylesheet:

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