cursor:pointer on buttons
cursor:pointer on buttons
CursorsCursorsCursorsCursors Published on:November 13, 2026Categories:CSSWG 8, CSS 96, OpinionCurrent music:Envy — Connected VoiceCurrent drink:Peppermint Tea Three weeks ago, at a CSS Working Grouping meeting, we discussed an issue “Cursors for base appearance”, and resolved on the following: The CSS Working Group just discussed [css-forms-1] Cursors for base appearance, and agreed to the following: RESOLVED: Adopt cursor rules in the last comment.
三周前,在一次 CSS 工作组会议上,我们讨论了“基础外观的光标(Cursors for base appearance)”议题,并达成如下决议:CSS 工作组刚刚讨论了 [css-forms-1] 基础外观的光标问题,并同意以下内容:决议:采用最后一条评论中的光标规则。
SUMMARY: Pointer = “click this thing”, text cursor says “prepare to enter text”, grabbing hand says “drag this”. One of the rules from the “last comment” mentioned there is select, option, input[type=checkbox], input[type=radio], button, input[type=button], input[type=submit], input[type=reset], input[type=color], input[type=image], ::file-selector-button { cursor: pointer; } Or, if we were to remove all non-button selectors, button { cursor: pointer; } That is, of course, not a change to the default styles in the browser — this is a rule for elements that will have an appearance: base-….
摘要:指针(Pointer)代表“点击此项”,文本光标代表“准备输入文本”,抓取手势代表“拖动此项”。“最后一条评论”中的规则之一提到:select、option、input[type=checkbox]、input[type=radio]、button、input[type=button]、input[type=submit]、input[type=reset]、input[type=color]、input[type=image]、::file-selector-button { cursor: pointer; } 或者,如果我们移除所有非按钮选择器,即 button { cursor: pointer; }。当然,这并不是对浏览器默认样式的更改——这只是针对具有 appearance: base-… 属性的元素的规则。
Also note that, this user agent style will be very much overrideable — no !important. Anyone who does not like cursor: pointer on buttons and other similar elements, are free to override it to default (or anything else) in their stylesheets. The rest of us can, I guess, celebrate? I was always on the side of this decision.
还要注意,这种用户代理样式是可以被覆盖的——没有使用 !important。任何不喜欢在按钮和其他类似元素上使用 cursor: pointer 的人,都可以自由地在他们的样式表中将其覆盖为默认值(或任何其他值)。我想,我们其他人可以庆祝一下了?我一直支持这个决定。
I published my “Correct Cursor on Active Elements” article in 2013. In 2017, I opened my first CSSWG issue — “Change the pointer cursor to indicate any interactive element”, which led to a change in a non-normative part of the spec. Since then, I did not see any new arguments in this debate. I will not repeat everything that I argued about, but one of the most common counter-arguments that I read today is “OS does not do it”.
我在 2013 年发表了我的文章《活动元素上的正确光标》。2017 年,我提出了我的第一个 CSSWG 议题——“更改指针光标以指示任何交互式元素”,这导致了规范中非规范部分的更改。从那时起,我没有看到这场辩论中有任何新的论点。我不会重复我所争论的一切,但我今天读到的最常见的反驳之一是“操作系统没有这样做”。
Did you see that “OS”? When was the last time your OS innovated anything in the UI? Did it become easier to use over years? Many of people with this argument ask, thinking that this will be a good question, something like “What next — change the cursor in the OS?!”. I mean… Yes? I would be happy with that.
你看到那个“操作系统”了吗?你的操作系统上一次在 UI 方面进行创新是什么时候?多年来它变得更容易使用了吗?许多持有这种观点的人在提问时,认为这是一个很好的问题,类似于“接下来是什么——更改操作系统中的光标吗?!”。我的意思是……是的?我很乐意看到那样。
When I look at like half of the (non-native) apps in my desktop OS, they have cursor: pointer on interactive elements. Cinny, Discord, Signal, Slack, Steam, VS Code — some of the apps that I have before me. When I use apps that do not change the cursor to anything other than default, I cringe. Default cursor does not communicate anything. It does one job well — point at a specific pixel. It could do more.
当我查看桌面操作系统中大约一半的(非原生)应用程序时,它们在交互式元素上都使用了 cursor: pointer。Cinny、Discord、Signal、Slack、Steam、VS Code——这些是我面前的一些应用程序。当我使用那些不将光标更改为默认值以外任何样式的应用程序时,我会感到不适。默认光标无法传达任何信息。它很好地完成了一项工作——指向特定的像素。它可以做得更多。
In the issue, many people came with dislikes and their arguments against cursor: pointer. I want to aknowledge one argument that I fully agree with — it would be great if buttons and links would have different cursors. And also, regular links should have cursors different from the links that are opened in new tabs. We need more cursors. But if we were to look at those three things: Blank space on the page. Buttons. Links. And then had only two cursors to assign to all of them, I know which ones I will assign to which. And I will never understand anyone thinking that buttons have more in common with blank space than with links.
在议题中,许多人表达了不满并提出了反对 cursor: pointer 的论点。我想承认一个我完全同意的论点——如果按钮和链接有不同的光标会很棒。此外,普通链接应该与在新标签页中打开的链接拥有不同的光标。我们需要更多的光标。但如果我们看看这三样东西:页面上的空白区域、按钮、链接。如果只有两种光标可以分配给它们,我知道我会把哪种分配给哪种。而且我永远无法理解为什么有人会认为按钮与空白区域的共同点比与链接的共同点更多。