Home > Web Front-end > CSS Tutorial > How to Prevent Links from Printing with Their Href Values in Chrome?

How to Prevent Links from Printing with Their Href Values in Chrome?

Mary-Kate Olsen
Release: 2024-10-31 04:55:30
Original
247 people have browsed it

How to Prevent Links from Printing with Their Href Values in Chrome?

Printing Without Href Values in Chrome

When attempting to customize the CSS for printing, you may encounter an issue where links are printed with their href values. This is the case in Chrome. For example, if you have the following HTML:

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

It will print as:

Google (http://www.google.com)
Copy after login

To resolve this and print only the link text, you can make use of the following CSS snippet for your printing stylesheet:

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

This will override the default behavior of Bootstrap and print links without their href values.

The above is the detailed content of How to Prevent Links from Printing with Their Href Values in Chrome?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template