我遇到了一个小问题,我无法从打印 View 中删除链接引用。
这是我在 HTML 端所能做的
<table style="width: 436px; height: 374px;" border="0" cellpadding="5">
<tbody>
<tr style="background-color: #edfbef;">
<td><span style="color: #3366ff;"><a title="Electricity Tariffs and Rates" href="http://newfea.oceanic.net.fj/your-home/electricity-tariffs-and-rates/"><span style="color: #3366ff;"><strong>Electricity Tariff & Rates</strong></span></a></span></td>
<td>Find out how you are being charged for the power you use at home</td>
</tr>
</tbody>
</table>
这是我的 header.php 页面上用于媒体查询的内容
<link href="<?php echo get_template_directory_uri(); ?>/resources/css/print.css" rel="stylesheet" media="print">
这是它在普通 HTML View 中的样子的快照
这是媒体打印愿景
您可以从打印 View 中看到链接的链接引用。有没有一种方法可以使用 CSS 删除它。
我已经尝试过display: none、visibility: hidden,但不行,因为它隐藏了整个链接文本。
最佳答案
@media print {
a[href]:after {
content: none !important;
}
}
尝试用上面的代码覆盖您的打印媒体
。
关于html - 从媒体打印屏幕中删除链接引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22188784/