我的css改变select经验代码

select {
   /*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
   border: solid 1px #000;
   width:18em;height:2.4em;
   font-size:1.2em;
   /*很关键:将默认的select选择框样式清除*/
   appearance:none;
   -moz-appearance:none;
   -webkit-appearance:none;

   /*在选择框的最右侧中间显示小箭头图片*/
   background: url("../images/down_spanrow.gif") no-repeat scroll right center transparent;


   /*为下拉小箭头留出一点位置,避免被文字覆盖*/
   padding-right: 14px;
}
select option{font-size:1.2em;line-height:1.4em;}

/*清除ie的默认选择框样式清除,隐藏下拉箭头*/
select::-ms-expand { display: none; }
发布了42 篇原创文章 · 获赞 8 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/dylwx_2005/article/details/91349906