Print a website without printing the link locations?

后端 未结 13 879
难免孤独
难免孤独 2020-12-15 03:26

I\'m invoking the navigator print function using a simple window.print(); call. It prints perfect (I want to print the same I see on the screen, so I don\'t really use a spe

13条回答
  •  情歌与酒
    2020-12-15 04:01

    Seems you are printing a page with this styling from a CSS2 compliant browser

    http://www.alistapart.com/articles/goingtoprint/

    In a fully CSS2-conformant browser, we can parenthetically insert the URLs of the links after each one, thus making them fairly useful to anyone who has a copy of the printout and a web browser handy. Here’s the rule, which restricts this effect to the “content” div and thus avoids sticking a URL in the masthead:

    #content a:link:after, #content a:visited:after {    
      content: " ("attr(href) ") ";    
      font-size: 90%;   
    }
    

    Try it out in a Gecko-based browser, like Mozilla or Netscape 6.x. After every link in the printout, you should see the URL of the link in parentheses.

提交回复
热议问题