开发者

Link isnt working when positioned with a background image?

I've got this link

<a href="/Admin/Product/Brands" class="newButton"></a>

Without the class attribute and a little bit of text, the link works fine, but when I add the class to apply the background image and position the button, the link stops working. It gives no errors in 开发者_高级运维the firefox console either. Any ideas? Heres my css rule for this:

a.newButton
    {
        margin: 5px;
        position:relative;
        left: 310px;
        top: -32px;
        display:block;
        height: 32px;
        width: 32px;
        background-image: url(Images/add-icon.png);
    }

This is in an ASP.NET MVC2 application, I am using the latest version of jquery (1.4.1) and this link is placed inside of a jQuery tab container, inside of a dialog.


Nick Craver had it right when he suggested the negative positioning value was moving the image outside of the clickable area. I used margin-top: -32 instead to move it back to where it was. The link is now clickable. Thanks to everyone for their suggestions.


Did you already try a high z-index for a.newButton ?

Maybe there is something in front of the Button.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜