删除下拉列表中的按钮 [英] Remove the button inside the dropdownlist

查看:251
本文介绍了删除下拉列表中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法隐藏或删除下拉列表中的箭头按钮?

Is there a way to hide or remove the arrow button inside a dropdownlist?

推荐答案

是的,至少在webkit: http://jsfiddle.net/zzTjy/1/

Yes, at least in webkit: http://jsfiddle.net/zzTjy/1/.

HTML

<select>
    <option>123</option>
</select>

CSS

SELECT { -webkit-appearance: none; }

值得注意的是Mozilla支持 -moz-appearance ,但它不隐藏下拉列表中的箭头。

It's worth noting that Mozilla supports -moz-appearance, but it doesn't hide the arrow in the dropdown list. This has been an open issue for quite some time.

Mozilla还声明:

Mozilla also states:


不要在网站上使用此属性:不仅是非标准的
,但其行为从一个浏览器更改为另一个。

Do not use this property on Web sites: not only is it non-standard, but its behavior change from one browser to another.

这可能有点恶劣,但你肯定不应该使用 appearance 来改变元素的预期行为。

This may be a bit draconian, but you certainly shouldn't use appearance to change the expected behavior of the element.

进一步阅读

  • More Examples
  • Bug to Implement in Mozilla
  • How to remove the arrow from a <select> tag in Firefox

这篇关于删除下拉列表中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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