CSS游标在WebKit浏览器中不起作用 [英] CSS Cursors are not working in WebKit browsers

查看:142
本文介绍了CSS游标在WebKit浏览器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了在WebKit浏览器中没有被拉过的游标的问题。猜测IE和Opera工作,我期望他们。这里是CSS

I am having trouble with cursors not being pulled through in WebKit browsers. Surprsingly IE and Opera work as I expect them to. Here's the CSS

    .olControlDrawFeatureActive {
         cursor: url(<DOMAIN>/common/images/cursors/draw.png), crosshair, default;
    }

它只是简单地将光标更改为绘制png或,如果它不接受自定义光标或PNG(如IE或Opera),那么它应该默认为十字准线。工作正常在IE和Opera,它去到十字线,因为我想要它,FireFox,Safari和Chrome在另一方面拒绝返回任何css为所有。看看Firebug中返回的CSS我只是得到。

It quite simply changes the cursor to either the Draw png or, if it doesn't accept custom cursors or PNGs (like IE or Opera) then it should default to the crosshair. Works fine in IE and Opera, it goes to the crosshair as I want it to, FireFox, Safari and Chrome on the other hand refuse to return any css for this at all. Looking at the returned CSS in Firebug I just get.

    .olControlDrawFeatureActive {
    }

空,完全无用。我试图用它的完整路径和相对路径和(这是最令人困惑的位为我)替换URL我试图删除自定义游标完全,所以它应该默认为十字准线,但仍然只是返回一个空的CSS规则!它已经bug了我一段时间,因为它原来工作正常在Webkit但不是在IE,使它工作在IE和现在WebKit决定不玩球!我做的东西真的明显错了吗?任何帮助或指针将非常感谢,因为它正在驱动我香蕉

Empty, and utterly useless. I have tried replacing the URL with it's full path and relative path and (and this is the most confusing bit for me) I have tried removing the custom cursor entirely so it should default to the crosshair, but still it just returns an empty CSS rule! It's been bugging me for a while now because it originally worked fine in Webkit but not in IE, got it working in IE and now WebKit decides to not play ball! Am I doing something really obvious wrong? Any help or pointers would be hugely appreciated as it is driving me bananas

推荐答案

发现问题!经过年龄的看和调整,我终于发布了我的第一个问题,然后在几分钟内回答。噢亲爱的。问题似乎在于我已经指定了3级游标,即自定义游标,十字准线和默认游标。没有必要有一个默认的在那里反正crosshair被所有浏览器接受。删除这似乎使它的工作。

Found the problem! After ages of looking and tweaking I finally post my first question and then answered it within a few minutes. Oh dear. The problem seemed to lay in the fact that I had specified 3 levels of cursors i.e. The Custom one, the Crosshair and the Default cursor. There was no need to have the default one in there anyway as Crosshair is accepted by all browsers. Removing this seemed to make it work.

这看起来很奇怪,CSS只允许两级游标?如果是这样,那么为什么Opera和IE接受它,他们只是忽略第一个?

This seems strange though, does CSS only allow for two levels of cursors? If so then why did Opera and IE accept it, do they just ignore the first one?

哦,工作的跨浏览器的快乐!如果他们都是相同的,我们一半可能会失业...

Oh the joys of working cross browser! Lets be fair, if they were all the same half of us would probably be out of a job...

修复CSS

    .olControlDrawFeatureActive 
    {
        cursor:url(<DOMAIN>/common/images/cursors/draw.png),crosshair;
    }

如果任何人想添加任何内容,请随意,对一些可怜的sod如我自己有用:)

If anyone wants to add anything please feel free, I'm sure it will be useful to some poor sod such as myself :)

这篇关于CSS游标在WebKit浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆