开发者

force webpage cursor

开发者 https://www.devze.com 2023-01-04 06:18 出处:网络
According to w3schools The cursor property specifies the type of cursor to be displayed when pointing on an element.

According to w3schools

The cursor property specifies the type of cursor to be displayed when pointing on an element.

However I found an elements cursor is not shown under certain browsers when working with a rich text editor, which uses an iframe. Firefox/Chrome/Safari/Konqueror work but IE/Opera do not.

Is there a way to reliably set the cursor in this case across all browsers? For example a way to set the cursor independent of which element is pointed at.

Edit: the cursor style is set on elements within the iframe. This works except that IE/开发者_运维知识库Opera can't seem to detect hover events properly within the iframe.


Maybe something like this would work in your stylesheet:

* { cursor:pointer!important; }

I also suspect you might have to apply a rule like this within the style of the text editor's frame. You should read the documentation of the editor for instructions on how to do it.


Given that the WYSIWYG editor uses an <iframe> and an <iframe> is its own document, your CSS won't doesn't apply to the contents of the <iframe>.

When you use an <iframe> the resulting DOM structure looks a little like this...

<html>
    <head>
        <title>iframe example</title>
        <link type="text/css" rel="stylesheet" href="outer.css" />
    </head>
    <body>
        <div>
            The contents of the outer document!
            <iframe>
                <html>
                    <head>
                        <title>iframe example</title>
                        <link type="text/css" rel="stylesheet" href="inner.css" />
                    </head>
                    <body>
                        <div>
                            The Contents of the iFrame!
                        </div>
                    </body>
                </html>
            </iframe>
        </div>
    </body>
</html>

... and the rules defined in outer.css don't apply to the contents of the <iframe>, and the contents of inner.css don't apply to the outer document.

0

精彩评论

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