Afonso Stack
Afonso Stack

Reputation: 55

Css cursor pointer doesn't work in html select on ie7?

I'm trying to set cursor as pointer for html select on ie7 but it doesn't work, is there a way to fix it?

<select style="cursor:pointer;">
    <option>test1</option>
    <option>test2</option>
</select>

Upvotes: 3

Views: 3700

Answers (1)

Spudley
Spudley

Reputation: 168685

IE7 does support the cursor:pointer style. -- see http://quirksmode.org/css/cursor.html. The only browsers that don't support it are IE5.5 and earlier, but you can safely ignore them these days.

So if it isn't working for you in this specific case, it's not IE7 in general that's at fault, so I'd suspect the <select> tag has a lot to do with it.

When IE renders a <select> element, it actually behind the scenes uses an ActiveX control to display the operating system's drop-down selector widget. This is different to how it handles other field types, which are rendered directly by the browser rendering engine.

This difference is usually transparent to the user, but does show up occasionally with the odd glitch.

The most common glitch is that <select> boxes ignore z-index, and always show on top in IE, making them harder to work with if you want to do clever stuff like toggle between a select box and an input field. Work arounds for this glitch usually involve an iFrame.

My guess would be that problems setting the cursor type on a select box are another glitch from this same underlying cause.

If this is the case, then I have my doubts that you're going to be able to do anything about it. You might just have to live with older versions of IE not being able to set the cursor for these fields.

Upvotes: 2

Related Questions