select框默认样式去除(ie中隐藏默认下拉图标)

本文介绍如何使用CSS清除默认的select选择框样式,并通过背景图片实现自定义下拉箭头,适用于IE和其他现代浏览器。
html代码

 

1  <select class="info-select">
2        <option selected="selected">1</option>
3        <option>2</option>
4  </select>
css代码
 /*清除ie的默认选择框样式清除,隐藏下拉箭头*/
          select::-ms-expand { display: none; }          
         .info-select{
            width: 12%;
            margin-left: 64%;
            border: none;
            outline: none;
            /*将默认的select选择框样式清除*/
            appearance:none;
            -moz-appearance:none;
            -webkit-appearance:none;
            -ms-appearance:none;
           /*在选择框的最右侧中间显示小箭头图片*/
           background: url(../img/arrow.png) no-repeat scroll right center transparent;           
         }

转载于:https://www.cnblogs.com/vanstrict/p/4979934.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值