首页 > 解决方案 > 从 Wikipedia Print Preview 中删除超链接下划线

问题描述

我想打印来自维基百科的一些文章,但我想从打印的所有单词中删除超链接下划线。


我正在使用 Wikipedia Account User Scripts Custom CSS删除链接,但无法使其正常工作,下划线仍显示在 Chrome 的打印预览中。我创建了一个维基百科vector.css主题覆盖,并清除了浏览器缓存,但我不知道 CSS 是否正在应用。

自定义 CSS

/* Remove Hyperlinks */
@media print {
    a:link {text-decoration: none !important;}
    a[href]:after {content: none !important;}
}

维基百科帐户小工具打印选项

我还使用小工具打印选项来删除其他元素,例如参考编号链接。

维基百科打印选项


铬打印视图

以及 Chrome 的打印预览功能,可以重新格式化页面以进行打印。

您可以在此处看到预览中的链接下划线。

铬打印视图

标签: cssprintingwikipedia

解决方案


将Chrome 的渲染切换为打印,您会看到他们在使用border-bottom. 你也需要敲掉它:

/* Remove Hyperlinks */
@media print {
    a:link {
        border-bottom: none !important;
        text-decoration: none !important;
    }
    a[href]:after {
        content: none !important;
    }
}

推荐阅读