select 边框颜色改变

来源:互联网 发布:有关群智能算法的问题 编辑:程序博客网 时间:2024/04/29 11:03

工作中经常遇到这种需求:select不用默认样式,而是改变其默认的样式
比如select默认有个边框 有个下拉箭头。

布局代码:

<span class="tesu_select">             <select>                 <option>5</option>                 <option>10</option>                 <option>15</option>             </select>   </span>

样式:

    span.tesu_select{    border: 1px solid #277de2;    border-radius:4px;    }    span.tesu_select select{         outline: none;        border: none;        width: 38px;        /*appearance: none;        -moz-appearance: none;        -webkit-appearance: none;*/这个是去除下箭头的        color: #277de2;    }

运行结果:
这里写图片描述

这样就完成了改变select默认样式了。

原创粉丝点击