Home > Article > Web Front-end > How to Prevent Href Attributes from Printing in Chrome?
Eliminating Href Attributes during Chrome Printing: A CSS Customization
Many users encounter an issue when customizing print CSS in Chrome: href values are printed alongside the hyperlink text. To resolve this problem, implement the following solution:
Bootstrap CSS includes a print mode rule that appends the href value after the link text:
<code class="css">@media print { a[href]:after { content: " (" attr(href) ")"; } }</code>
To remove the href display, modify the print stylesheet:
<code class="css">@media print { a[href]:after { content: none !important; } }</code>
This modification overrides the Bootstrap rule, ensuring that only the link text is printed.
The above is the detailed content of How to Prevent Href Attributes from Printing in Chrome?. For more information, please follow other related articles on the PHP Chinese website!