css - 如何隐藏每张图像底部打印的操作链接

标签 css printing

我的页面包含多张图片:

<a class="fancybox" href="img/16.jpg"><img src="img/16.jpg" class="center-block img-responsive"></a> 

当我打印页面(chrome)时,href 在每个图像的底部可见。

那么,如何隐藏每张图片底部打印的操作链接?

例如,当我将“隐藏打印”类应用于操作 block 时,我的图像就消失了......

最佳答案

我无法在 Chrome 上重现该问题,所以我猜这不是因为 anchor 标记。正如 jackson 已经说过的,你可能会,

a:after {
   content: " (" attr(href) ")";
}

在您的任何 css 框架中(如果您使用过的话)。

if you're using Twitter Bootstrap as a framework, this will work for you(from https://stackoverflow.com/a/14931127/3556874):

a[href]:after{
    content:"";
}

If you are not sure , where is it written or if you can not change the external css, you will also require to consider the :before pseudo class

@media print{

 a[href]:after{
        content:"";
    }
 a[href]:before{
        content:"";
    }

}

关于css - 如何隐藏每张图像底部打印的操作链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28561419/

相关文章:

javascript - 使用 Internet Explorer 打印 html 页面

c - c中打印数字输出错误

带有scroll-margin-top的Javascript平滑滚动在末尾创建一个跳转

jquery - 如何在页面底部显示 jquery mobile 弹出窗口?

css - 从 Angular Material <mat-chip> 中移除 box-shadow

c - 如何使用 Nasm 汇编器使用 C-printf() 仅打印一定数量的字节?

javascript - 我用于更改 css 的 javascript 脚本似乎无法正常工作

javascript - 如何从 knob.js 获取值

wpf - 从文件加载图像并使用WPF打印...如何?

php - 在javascript中打印页面