在 Firefox 中,打印带有锚标记的页面时,链接位置打印在文本之后

发布于 2024-08-19 14:16:41 字数 226 浏览 4 评论 0原文

例如,

<a href="../somepage/page.aspx?qs=asdf">Text Here</a>

将打印为...


Text Here(../somepage/page.aspx?qs=asdf)


在 IE 中,它看起来很正常(不打印 url)。有什么想法为什么会这样吗?

For example,

<a href="../somepage/page.aspx?qs=asdf">Text Here</a>

will print out as...


Text Here(../somepage/page.aspx?qs=asdf)


In IE, it looks normal (doesn't print the url). Any ideas why this is acting in this fashion?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

送你一个梦 2024-08-26 14:16:42

只需将其添加到您的布局页面(母版页)中

a[href]:after {
        content: none !important;
    } 

Just add this in your layout page (Master Page)

a[href]:after {
        content: none !important;
    } 
暗恋未遂 2024-08-26 14:16:42

在链接旁边打印 url 也有语义原因。
假设您打印没有 url 的文档。您不能确定完全理解作者的意思。

引用也可能需要打印源代码。这对于学术文本来说很重要。

事实上,布雷特的回答是正确的。

There is also the semantic reason to print the url next to the link.
Imagine you print the document without the url. You cannot be sure to completely understand the text as it is meant by the author.

It can be necessary for a quote to print the source as well. That is important i.e. for academic texts.

Indeed Bretts answer is correct.

我不咬妳我踢妳 2024-08-26 14:16:42

您可以通过在打印样式链接上包含媒体属性来完全避免屏幕上的此问题,如下所示

<link href="../../Content/blueprint/print.css" rel="stylesheet" media="print" type="text/css" />

You can avoid this problem altogether on the screen by including the media attribute on the print style link as follows

<link href="../../Content/blueprint/print.css" rel="stylesheet" media="print" type="text/css" />
梦里寻她 2024-08-26 14:16:41

从 Brett 的答案推断,在 Firefox 25 上,这种 CSS 样式删除了有问题的 href:

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

Extrapolating from Brett's answer, on Firefox 25, this CSS style removes the offending href:

@media print {
    a:link:after,
    a:visited:after {
        content: "" !important;
    }
}
多情癖 2024-08-26 14:16:41

另外,如果您使用 Twitter Bootstrap 作为框架,那么:

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

... 就可以了! (至少在引导程序 3 中)

Also, if you're using Twitter Bootstrap as a framework, this:

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

... will do the trick! (at least in bootstrap 3)

青巷忧颜 2024-08-26 14:16:41

答案就在我们正在使用的 CSS 框架(Blueprint)中。样式文件中有以下行:

a:link:after,a:visited:after{content:"(" attr(href) ")";font-size:90%}

我猜这可能会对使用蓝图的其他人有所帮助。

The answer was in the css framework we are using (Blueprint). There was the below line in the style file:

a:link:after,a:visited:after{content:"(" attr(href) ")";font-size:90%}

Guess this might help others who use Blueprint.

比忠 2024-08-26 14:16:41

如果您想要更具体 - 例如删除表中的链接,那么您可以使用 jQuery 执行以下操作。

$(".tableclass tr td a").removeAttr("href");

If you want to to be more specific - say remove links within a table, then you could do the following with jQuery.

$(".tableclass tr td a").removeAttr("href");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文