douhu4091 2014-10-09 12:19
浏览 14

打印模式下的HTML页面显示所有锚链接

When I choose to print out any page of my web app, it gets printed with <a> links being visible. That is very odd behaviour that did not happen before.

The only information I can provide right now is that the app is developed with cakePHP framework and that it happens for every link, no matter if it is text or image.

I attach a couple of code below:

<p>
   <a href="users/view/5668" class="username">John Doe</a>
</p>
<a href="users/add">
    <img src="/img/add_icon.png">
</a>

In the printable version it looks like this:

/users/view/5668 John Doe

And what I need to be printed is just the John Doe

Any help, suggestions or guidance is much appreciated. If there is any other valuable information that I could provide, just ask.

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dtjo87679 2014-10-09 12:26
    关注

    @media print { a { display:none } } Edit### Answered on the following post SO post1

    a
    

    { content:attr(href);display:none }

    评论

报告相同问题?