0

On the HTML page (with Angular 1.2) I am displaying the button

     <a href="www.google.com" class="btn btn-default">
       Hello
     </a>

It looks normal in browser, but when I print it (from Chrome or Safari) I see what the URL is printing, against my intention, as below:

Hello (www.google.com)

How do not print the naked URL in href?

CGutz
  • 537
  • 2
  • 7
  • 20
user510040
  • 159
  • 2
  • 10
  • 3
    what does this have to do with angular? that looks like standard HTML to me. – Claies Oct 12 '15 at 18:53
  • What exactly is a _"naked"_ url? – War10ck Oct 12 '15 at 18:53
  • 1
    This could be either a print stylesheet or a browser setting. If it's the former you can edit it (probably it would have a selector such as `a::after`), if it's a browser setting then you can't influence or change the behaviour (unless you change your browser's settings, or give users detailed instructions; which is unlikely to be followed). Bear in mind that hidden URLs are pointless in printed text, without showing the user the link. – David Thomas Oct 12 '15 at 18:54
  • You need an absolute URL (with protocol) – SLaks Oct 12 '15 at 18:54
  • 1
    Make sure to search before asking a question - tons of questions answer this already: http://stackoverflow.com/questions/7301989/need-to-remove-href-values-when-printing-in-chrome – patricksweeney Oct 12 '15 at 18:54
  • 1
    You are most likely looking to hide anchor tags' contents using the css media query for print. If you cannot find what you're looking for after using those search terms, make a new question with a better understanding of your problem. – Hypaethral Oct 12 '15 at 18:56

1 Answers1

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

As @patricksweeney said.

Giuseppe
  • 464
  • 13
  • 24