In Firefox, when printing a page with anchor tags, the link location is printing after the text
Asked Answered
P

7

14

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?

Polymeric answered 29/1, 2010 at 15:29 Comment(3)
It doesn't actually... What ff version are you using?Concernment
This happens on Firefox 26 out of the box. @SteveEynon's answer fixes the issue (or disables the feature).Guelders
Surely there must be some configuration option in the browser itself to disable this?Inflorescence
P
6

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.

Polymeric answered 29/1, 2010 at 15:40 Comment(0)
M
27

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;
    }
}
Melo answered 29/11, 2013 at 23:30 Comment(0)
A
8

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

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

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

Adonic answered 8/1, 2014 at 15:5 Comment(1)
I had to add !important otherwise it wouldn't work.Saunder
P
6

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.

Polymeric answered 29/1, 2010 at 15:40 Comment(0)
F
1

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");
Freestanding answered 28/5, 2014 at 13:30 Comment(0)
S
1

Just add this in your layout page (Master Page)

a[href]:after {
        content: none !important;
    } 
Submerse answered 11/12, 2015 at 10:31 Comment(0)
C
0

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.

Cota answered 30/1, 2010 at 0:52 Comment(0)
V
0

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" />
Vinery answered 7/4, 2010 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.