您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

css怎么改变鼠标形状

2024/5/2 1:36:30发布41次查看
css改变鼠标形状的方法是,在指定元素上添加cursor属性,并将属性值设置为需要的值,如pointer、move、text等,具体代码如【d4fb9f4da014fa48a0b58d56d3613adcpointer54bdf357c58b8a65c66d7c19c8e4d114】。
本文操作环境:windows10系统、css 3、thinkpad t480电脑。
css给我们提供了一个非常好用的属性,它就是cursor属性,下面让我们来一起看看这个属性。
cursor 属性规定要显示的光标的类型(形状)。
常用的一些属性值:
default    默认光标(通常是一个箭头)    
auto    默认。浏览器设置的光标。    
crosshair    光标呈现为十字线。    
pointer    光标呈现为指示链接的指针(一只手)    
move    此光标指示某对象可被移动。    
text    此光标指示文本。    
wait    此光标指示程序正忙(通常是一只表或沙漏)。    
help    此光标指示可用的帮助(通常是一个问号或一个气球)。    
代码示例:
<html><body><p>请把鼠标移动到单词上,可以看到鼠标指针发生变化:</p><span style="cursor:auto">auto</span><br /><span style="cursor:crosshair">crosshair</span><br /><span style="cursor:default">default</span><br /><span style="cursor:pointer">pointer</span><br /><span style="cursor:move">move</span><br /><span style="cursor:e-resize">e-resize</span><br /><span style="cursor:ne-resize">ne-resize</span><br /><span style="cursor:nw-resize">nw-resize</span><br /><span style="cursor:n-resize">n-resize</span><br /><span style="cursor:se-resize">se-resize</span><br /><span style="cursor:sw-resize">sw-resize</span><br /><span style="cursor:s-resize">s-resize</span><br /><span style="cursor:w-resize">w-resize</span><br /><span style="cursor:text">text</span><br /><span style="cursor:wait">wait</span><br /><span style="cursor:help">help</span></body></html>
大家可以复制上面的到本地去运行,看看具体的运行效果。
相关视频分享:css视频教程
以上就是css怎么改变鼠标形状的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product