css样式自定义鼠标光标_CSS自定义光标

本文介绍了如何使用CSS轻松自定义网页的鼠标光标,包括如何设置自定义CSS光标,以及在何处适当使用自定义光标以提高用户体验。文章还提到了不同浏览器对光标大小的处理差异。
摘要由CSDN通过智能技术生成

css样式自定义鼠标光标

Remember the Web 1.0 days where you had to customize your site in every way possible?  You abused the scrollbars in Internet Explorer, of course, but the most popular external service I can remember was CometCursor.  CometCursor let you create and use loads of custom cursors for your site.  Now we probably laugh at that in hindsight but there may be times when you'd like to customize a cursor, and CSS lets you do it quite easily!

还记得Web 1.0的日子,您必须以各种方式自定义网站? 您当然滥用了Internet Explorer中的滚动条,但是我记得最流行的外部服务是CometCursor。 CometCursor允许您为站点创建和使用自定义游标的负载。 现在我们可能会事后大笑,但是有时候您可能想要自定义游标,而CSS可以让您轻松自如!

CSS (The CSS)

The cursor CSS property accepts a series of cursors, and using a url() value allows you to set a custom CSS cursor:

cursor CSS属性接受一系列光标,使用url()值可以设置自定义CSS光标:


body {
	cursor: url('some-cursor.ico'), default;
}


It's always best to have a backup native cursor like default, much as you set broader font-family's when styling text.  Also note that Firefox scales the cursor down to a smaller size whereas Chrome currently allows a larger original size.

最好总是有一个像default这样的备用本地游标,就像在设置文本样式时设置更宽的font-family 。 另请注意,Firefox将光标缩小到较小的尺寸,而Chrome当前允许较大的原始尺寸。

Now don't go doing this willy nilly, use a custom cursor in places where you think important, like a magnifying glass + or - over zoomable images and such.

现在,不要再随意了,请在您认为重要的地方使用自定义光标,例如放大镜+或-缩放图像等。

翻译自: https://davidwalsh.name/css-custom-cursor

css样式自定义鼠标光标

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值