SlickRick
SlickRick

Reputation: 25

Get rid of dotted line around for input type image?

I've tried doing this a bunch of different ways. Nothing seems to work. What am I missing here?

HTML code:

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr"     method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="someval">
<input type="image" src="Btn.PNG" border="0" 
    name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/WEBSCR-640-20110401-    1/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Tried Javascript:

function NoLinkBorder()
{
    var links = document.getElementById('noborder').getElementsByTagName('a');
    for ( var i = 0; i < links.length; i++ ) 
    {
        links[i].onmousedown = function () 
        {
            this.blur();
            return false;
        }
        links[i].onclick = function() 
        {
            this.blur();
        }
        if ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ) 
        {
            links[i].onfocus = function() 
            {
                this.blur();
            }
        }
    }
}

And yes I used the right id tag

I tried a couple differenet css techniques. One wraping the form in a div:

.MoneyButton {     
    background:url(Btn.PNG) no-repeat;     
    cursor:pointer;     
    border: none; 
}


div.MoneyButton input { 
    background:url(Btn.PNG) no-repeat; 
    width: 534px;     
    height: 260px;     
    border: none; 
} 

also tried a simple css technique:

a:focus {
    outline: 0;
}

and

a:focus {
    outline: none;
}

Nothing seems to work. the dotted line still shows up around the image/form when clicked in IE 8.

any ideas?

Upvotes: 0

Views: 4097

Answers (1)

BoltClock
BoltClock

Reputation: 723538

<input type="image"> is of type input, which is why the outline style isn't applying to it.

Remove the a from your focus style so it applies to any elements in focus, not just a elements:

:focus {
    outline: none;
}

Upvotes: 4

Related Questions