首页 > Web开发 > 详细

用纯css改变下拉列表select框的默认样式

时间:2020-03-16 17:39:18      阅读:61      评论:0      收藏:0      [点我收藏+]

html

<div id="parent">
  <select>
      <option>what</option>
      <option>the</option>
      <option>hell</option>
  </select>
</div>

css

#parent{
    background: url(‘https://raw.githubusercontent.com/ourjs/static/gh-pages/2015/arrow.png‘) right center no-repeat; 
   /* the width and the height of your image */
    width: 100px;
    height: 30px;
    overflow: hidden;
    border: solid 1px #ccc;
}

#parent select{
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background:transparent;
    border:none;
    padding-left:10px;
    width: 120px;
    height:100%;    
}

参考文档:http://ourjs.com/detail/551b9b0529c8d81960000007

用纯css改变下拉列表select框的默认样式

原文:https://www.cnblogs.com/yechangzhong-826217795/p/12504779.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!