将光标移到< option>标签? [英] Change cursor over <option> tags?

查看:81
本文介绍了将光标移到< option>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当悬停在< select> 组合框中的项目时,是否有任何方法更改光标?我假设做选项{cursor:pointer; }

Is there any way to change the cursor when hovering over an item in a <select> combobox? I assumed that doing option { cursor: pointer; } in CSS would work, but it doesn't seem to.

推荐答案

很遗憾,< option> 标签是由操作系统而不是浏览器呈现的,因此您无法使用游标对它们进行样式化。而应使用类似 Bootstrap的下拉菜单的插件。

Sadly, <option> tags are rendered by the operating system, not the browser, so you can't style them with cursors. Instead, use a plugin like Bootstrap's Dropdown.

MSDN说最好


除了背景颜色和颜色外,通过style元素的样式对象应用的样式设置将被忽略。此外,直接应用于单个选项的样式设置会覆盖整个应用于包含select元素的样式设置。

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing select element as a whole.

MDN也会在中发音


一些元素根本不能使用CSS样式。这些包括所有高级用户界面小部件,如范围,颜色或日期控件以及所有下拉窗口小部件,包括< select> ; option> < optgroup> < datalist> 文件选择器小部件也已知不是可定制的。 < progress> < meter> 元素也属于此类别。

Some elements simply can't be styled using CSS. These include all advanced user interface widgets such as range, color, or date controls as well as all the dropdown widgets, including <select>, <option>, <optgroup> and <datalist> elements. The file picker widget is also known not to be stylable at all. The new <progress> and <meter> elements also fall in this category.

这篇关于将光标移到&lt; option&gt;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆