Print a website without printing the link locations?

后端 未结 13 864
难免孤独
难免孤独 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:43

    For anyone using Bootstrap 3, the selector used is:

    a[href]:after { }
    

    And can be overriden with something like:

    a[href]:after {
       content: initial;
    }
    
    0 讨论(0)
  • 2020-12-15 03:51

    I found the other solutions don't work (anymore) cross-browser. The following works in FF 29, Chrome 35, IE 11:

    a:link:after, a:visited:after {  
      content: normal !important;  
    }
    
    0 讨论(0)
  • 2020-12-15 03:51

    While many css options have been suggested, if you wish to get rid of the links and headings in the header/footer which is forced on each page, there is a setting just for you. As shown below.

    Remove Footer Links in Chrome Print View

    That's it.

    0 讨论(0)
  • 2020-12-15 03:57

    content: ""; does not work I use this:

    @media print {
        .noprint {display:none !important;}
        a:link:after, a:visited:after {  
          display: none;
          content: "";    
        }
    }
    

    This works to disable!

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-15 03:59

    Adding this will help you to remove those unwanted links

    <style type="text/css" media="print">
    @page 
    {
        size: auto;   /* auto is the initial value */
        margin: 0mm;  /* this affects the margin in the printer settings */
    }
    

    Reading this will help

    0 讨论(0)
提交回复
热议问题