本来没有写文章的习惯,但是闲下来了,整理资料,发现还挺纠结,对前端来说。所以整理下,希望对看到的人有所帮助,毕竟我不是前端开发。
起因,是前端告诉我select 框的三角箭头不能自定义。但是第二次的时候,以我自己的感觉中,是可以自己定义的,于是网上找到了这部分资料。
然后自己分享处理吧。
知道大家都喜欢完整的demo,所有直接粘贴吧。


<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>select 右边下拉箭头 demo ... 简单的56个民族</title> <style type="text/css"> select { /*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/ border: solid 1px red; /*很关键:将默认的select选择框样式清除*/ appearance:none; -moz-appearance:none; -webkit-appearance:none; /*在选择框的最右侧中间显示小箭头图片*/ /*background: url("./arrow.jpg") no-repeat scroll right center transparent;*/ /*background: url("./arrow.jpg") no-repeat scroll 170px 15px transparent;*/ /*为下拉小箭头留出一点位置,避免被文字覆盖*/ padding-right: 35px; padding-left: 4px; border-radius: 4px; } /*清除ie的默认选择框样式清除,隐藏下拉箭头*/ select::-ms-expand { display: none; } .test{ width:200px; height:40px; background: url("./arrow.jpg") no-repeat scroll 170px 15px t