Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove url (shown after links) from a printed page (Chrome)?

Not referring to the URL at top of page.

When an <a> tag is printed in Chrome, it shows the URL after it.

Instead of just showing the anchor text (like this: StackOverflow)

It shows the anchor text w/ URL after it

(like this: StackOverflow (window.open('www.stackoverflow.com'))

This makes the printed page stretch off the printable area, and I'm trying to avoid this from happening. Can this setting be disabled somehow in printing mode or is there a @media print style that can be defined to remove this URL part from print screen?

like image 315
Control Freak Avatar asked Nov 05 '25 21:11

Control Freak


1 Answers

Tell it not to print anything after the anchor tag.

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

}
like image 105
davidcondrey Avatar answered Nov 08 '25 11:11

davidcondrey