欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

css鼠标指针光标样式_高级CSS光标–通过指针提高可用性

程序员文章站 2024-02-10 14:09:16
...

css鼠标指针光标样式

All browsers provide their own stylesheet which includes settings link colors (blue for unvisited and purple for visited, in IE's case), default padding and margins, text sizes, and cursors. Browsers provide the pointer cursor to make it obvious to the user that the text or image that serves as the link is clickable. What about the other cases for clicking on elements? These elements include:

所有浏览器都提供自己的样式表,其中包括设置链接颜色(对于IE,蓝色为未访问,紫色为已访问),默认填充和边距,文本大小以及光标。 浏览器提供了指针光标,以使用户可以明显看出用作链接的文本或图像是可单击的。 在其他情况下点击元素呢? 这些元素包括:

  • Input buttons (type button, submit, and reset)

    输入按钮(类型按钮,提交和重置)
  • Elements with an onclick event

    带有onclick事件的元素

  • Label elements

    标签元素
  • Select elements

    选择元素
  • Javascript triggers (Mootools Accordians, for example)

    Javascript 触发器 (例如Mootools Accordians)

It's clear that there's an opportunity to improve usability with some simple CSS. Since the focus of this is to improve usability and inconsistency in functionality would cause more harm than good, we'll use the proven CSS class method to apply our improvements. We'll also use general HTML element selectors.

显然,有机会通过一些简单CSS来提高可用性。 由于这样做的重点是提高可用性,功能不一致会带来弊大于利的情况,因此,我们将使用经过验证CSS类方法来应用我们的改进。 我们还将使用常规HTML元素选择器。


select,label,.pointer { cursor:pointer; }

Apply the pointer class to button inputs, elements with onclick events, and JavaScript triggers. Do not use pseudo-classes such as input[type='submit'] as IE6 does not support this.

将指针类应用于按钮输入,具有onclick事件的元素和JavaScript触发器。 请勿使用诸如input [type ='submit']之类的伪类,因为IE6不支持此类。

Another quick CSS addition to increase usability within minutes.

另一个快速添加CSS的功能,可在几分钟内增加可用性。

翻译自: https://davidwalsh.name/css-cursors-pointer

css鼠标指针光标样式