在 Firefox 中,打印带有锚标记的页面时,链接位置打印在文本之后
例如,
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
只需将其添加到您的布局页面(母版页)中
Just add this in your layout page (Master Page)
在链接旁边打印 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.
您可以通过在打印样式链接上包含媒体属性来完全避免屏幕上的此问题,如下所示
You can avoid this problem altogether on the screen by including the media attribute on the print style link as follows
从 Brett 的答案推断,在 Firefox 25 上,这种 CSS 样式删除了有问题的 href:
Extrapolating from Brett's answer, on Firefox 25, this CSS style removes the offending href:
另外,如果您使用 Twitter Bootstrap 作为框架,那么:
... 就可以了! (至少在引导程序 3 中)
Also, if you're using Twitter Bootstrap as a framework, this:
... will do the trick! (at least in bootstrap 3)
答案就在我们正在使用的 CSS 框架(Blueprint)中。样式文件中有以下行:
我猜这可能会对使用蓝图的其他人有所帮助。
The answer was in the css framework we are using (Blueprint). There was the below line in the style file:
Guess this might help others who use Blueprint.
如果您想要更具体 - 例如删除表中的链接,那么您可以使用 jQuery 执行以下操作。
If you want to to be more specific - say remove links within a table, then you could do the following with jQuery.