2017-08-08 76 views
1

首先,我想知道为什么我需要为<button><label>,复选框和收音机等元素添加cursor:pointer;来保留悬停效果?为什么<button>默认情况下在悬停时没有指针光标?

二,为什么<a>标签默认有这个?

+1

已在UX Stack Exchange上提出此问题:https://ux.stackexchange.com/questions/105024/why-dont-button-html-elements-have-a-css-cursor-pointer-by-default – alexmuller

+1

There是[UX SE。]上的一个类似问题(https://ux.stackexchange.com/questions/105024/why-dont-button-html-elements-have-a-css-cursor-pointer-by-default) – Octopus

回答

-1

这来自网页使用的历史角度。标签应该是只读的。按钮,复选框和收音机默认是可见的可点击。所以,任何人都可以在页面上看到他们,他们知道它可以被点击或检查。一个锚标签可能会隐藏在页面上的其他文本之间,并且可能通过样式隐藏在视图中,所以悬停指针(如果它们有指向的url)将表示这是可点击的文本部分,并且将有助于页面导航。

你可以在这里查看更多的答案这些细节。 https://ux.stackexchange.com/questions/105024/why-dont-button-html-elements-have-a-css-cursor-pointer-by-default

conceptual details of mouse pointers here

相关问题