views:

41

answers:

1

Can someone tell me how to stop IE8 printing the value of the href for an A tag next to the text. For example this markup

<a href="/site/page.html">Some Link</a>

When printed comes out as

Some Link(/site/page.html)

when printed. How can I stop this?

+3  A: 

This doesn't happen for me in IE8 and I've never spotted it. I also can't find it in the Internet Options anywhere.

It is possible that you have some software on your computer that does this, for example AVG Anti-Virus adds content to web pages to tell you that it has checked the links being displayed for potentially harmful content - so your system-security software may be expanding all links to show you where they actually point, to prevent phishing attacks.

If you do have some anti-phishing software on your machine, you'll have to find the option within that.

Update - It is almost certainly some clever CSS.

I have created the following test page to demonstrate how you can add the URL to a link using CSS generated content. If this was used within a print stylesheet, this would explain how the URL is getting added to the link when you are printing the page. To stop this, you would have to save a copy of the web page, remove the style rule from the print-only style sheet and then open your copy and print it!

<html>
<head>
<title>Test</title>
    <style type="text/css">
    a:after {
        content: " [" attr(href) "] ";
    }
    </style>
</head>
<body>
    <h1>Test</h1>
    <p>This is a test to see if this 
    <a href="http://www.stevefenton.co.uk/"&gt;Link Shows A URL</a></p>
</body>
</html>
Sohnee
You may be close as it seems no-one else has this issue. The problem ONLY appears when Printing. I cannot imagine any AV having control on how the page is printed but I could be wrong. Thanks for your response I will check it out
Scott Warren
I tried it on another client with IE8 (Windows 7) and still the same result in Print Preview. I use ESet NOD.
Scott Warren
Ah - interesting. I've checked the ESET website and I can't find any reference to this, I will see if I can find another answer!
Sohnee
Hello again, I've had a quick thought... is the page you are talking about available online anywhere. I'm wondering if they have an alternate stylesheet for printing that has something clever going on and if I can take a look I can at least rule out this possibility.
Sohnee
You got it! The CSS is in Blueprint's CSS print.css. Thanks so much. I never suspected it.
Scott Warren