在网页中更改鼠标指针

9
我已经使用HTML创建了一个框架。

我使用了

<frame></frame>

标签。 当鼠标进入框架时,是否有一种方法可以更改鼠标指针。

5个回答

12

这里可以找到。

这是有关光标的CSS。

尝试:

<frame style="cursor:auto"></frame>

你可以使用以下任何一种代替 auto

auto    Default. The browser sets a cursor
crosshair   The cursor render as a crosshair
default The default cursor
e-resize    The cursor indicates that an edge of a box is to be moved right (east)
help    The cursor indicates that help is available
move    The cursor indicates something that should be moved
n-resize    The cursor indicates that an edge of a box is to be moved up (north)
ne-resize   The cursor indicates that an edge of a box is to be moved up and right (north/east)
nw-resize   The cursor indicates that an edge of a box is to be moved up and left (north/west)
pointer The cursor render as a pointer
progress    The cursor indicates that the program is busy (in progress)
s-resize    The cursor indicates that an edge of a box is to be moved down (south)
se-resize   The cursor indicates that an edge of a box is to be moved down and right (south/east)
sw-resize   The cursor indicates that an edge of a box is to be moved down and left (south/west)
text    The cursor indicates text
w-resize    The cursor indicates that an edge of a box is to be moved left (west)
wait    The cursor indicates that the program is busy

7

使用CSS属性cursor

<style>
.mousePointer
{
    cursor: pointer;
}
</style>

<frame class="mousePointer"></frame>

5

4

使用CSS:

.myClass { cursor: pointer; }
#myId { cursor: pointer; }

或者整个元素:

frame { cursor: pointer; }
p { cursor: pointer; }

你也可以尝试使用内联CSS:

或者像这样:

<div id="clickMe" onclick="alert('I\'m clicked!'); return false;" style="cursor: pointer;">I'm a Fake-Link!</a>

2
你可以这样做:-
HTML
  <iframe class="pointer"></iframe>

CSS

   .pointer
          {
            cursor: pointer;
          }

更改光标的其他选项包括:-
 auto
 crosshair
 default
 e-resize
 help
 move
 n-resize
 ne-resize
 nw-resize
 pointer
 progress
 s-resize
 se-resize
 sw-resize
 text
 w-resize
 wait

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接