CSS自定义select选择框样式(右侧下拉箭头)

如图:自定义select的箭头样式

 HTML以及CSS代码如下:

<select class="form_select">
    <option value="0">请选择</option>
    <option value="1">aaaaa</option>
    <option value="2">bbbbb</option>
</select>
.form_select {
    /* 清除默认边框 */
    border: 0;
    /* 清除默认的箭头样式 */
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    /* 右侧添加小箭头的背景图 */
    background: url('../../img/select_arrow.png') 230px center no-repeat;
    background-size: 12px;
}

猜你喜欢

转载自blog.csdn.net/xiaomajia029/article/details/82908719
今日推荐