开发者

What's the best way to fix this IE7 bug (cursor of the floatted/block span into an a)

开发者 https://www.devze.com 2023-03-26 07:41 出处:网络
I think this is a common IE7 problem. When I insert a span (block or floated) into an a the cursor of the link vanish.

I think this is a common IE7 problem. When I insert a span (block or floated) into an a the cursor of the link vanish.

<a class='myLink' href=http://www.link.com>
    <span class='mySpan'>There isn't the cursor</span>
</a>

.myLink
{       
    text-decoration:none;
}

.mySpan
{
    float:left; 
}

my solution usually is to put cursor:pointer; in the span... but maybe there i开发者_Python百科s a more correct way. Do you know?


Have a look at this - http://robertnyman.com/2008/01/22/cant-make-links-appear-clickable-in-ie/

It seems that if the span gets it's 'haslayout' property set as it does in your example due to the 'float:left' then the link cursor is removed. If you remove the 'float:left' then the link cursor appears again. There are a number of solutions mentioned in the link but I think your best/simplest bet would be -

a span {
   cursor: pointer; 
}


if you need to float the span inside the link, cursor:pointer is the way to go.

0

精彩评论

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

关注公众号