How to remove href values when printing in Chrome ? CSS Print Styles

If you are using twitter bootstrap and print a web page suing Google chrome, you will see href values of  links. If you don’t want href values in print then you will have to disable them in CSS.

Here is an example.

For this html:

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

It prints:

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

And you want it to print:

Google
   

Bootstrap does the same thing.

@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;
  }
}

It doesn’t. Somewhere in your print stylesheet, you must have this section of code:

a[href]::after {
    content: " (" attr(href) ")"
}
Advertisements

Tagged: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: