将光标更改为< option>标签? [英] Change cursor over <option> tags?

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

问题描述

当将鼠标悬停在< select> 组合框中的项目上时,是否有任何方法可以更改游标?我假设做选项{cursor:pointer; } 在CSS中可以工作,但似乎似乎没有。

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.

推荐答案

c $ c>< 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说最好


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

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> ;选项> < 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天全站免登陆