Print a website without printing the link locations?

后端 未结 13 876
难免孤独
难免孤独 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 03:59

    So to avoid additional print-out of link information in a printed web page, add the following rules to the @media print section:

    a:link:after, a:visited:after {
        content: "";
    }
    

    This will remove the ugly link information like Homepage (http://localhost) and reduce it to Homepage. You may of course add rules to avoid it only in the text section (or only in the navigation, but you shouldn't display navigation in the print-out format of your web page.

提交回复
热议问题