twitter-bootstrap 从 Bootstrap 3 中的表单元素选择中删除箭头

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24038951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 20:54:08  来源:igfitidea点击:

Remove arrows from form element select in Bootstrap 3

htmlcsstwitter-bootstrap

提问by nomie

I would like to remove the up/down arrows that show up next to the clock icon on right. Here is the image:

我想删除右侧时钟图标旁边显示的向上/向下箭头。这是图像:

enter image description here

在此处输入图片说明

Here is the HTML:

这是 HTML:

<div class="form-group">
    <label class="control-label">Date:</label>
    <div class="right-inner-addon ">
        <i class="glyphicon glyphicon-time"></i>
        <select class="form-control input-lg">
            <option value="01">01</option>
            <option value="02">02</option>
            <option value="03">03</option>
            <option value="04">04</option>
            <option value="05">05</option>
            <option value="06">06</option>
            <option value="07">07</option>
        </select>
    </div>
</div> 


After applying the suggest css change below this is the result:


应用下面的建议 css 更改后,结果如下:

enter image description here

在此处输入图片说明

回答by Luís P. A.

Try this using the appearanceproperty:

试试这个使用appearance属性:

The appearanceproperty allows you to make an element look like a standard user interface element.

appearance属性允许您使元素看起来像标准的用户界面元素。

select.form-control {
  -moz-appearance: none;
   -webkit-appearance: none;
   appearance: none;
}