您的位置:首页 > Web前端 > CSS

修改select的默认样式

2016-07-21 16:17 477 查看
---------------------HTML------------------------

<div id="parent">

  <select>

      <option>what</option>

      <option>the</option>

      <option>hell</option>

  </select>

</div>

----------------------CSS------------------------

#parent{

    background: url('http://ourjs.github.io/static/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%;    

}

----------------------效果-------------------------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css