How to change bootstrap select arrows to glyphicon?

前端 未结 2 604
迷失自我
迷失自我 2020-12-21 00:03

I want to achieve something like this, except arrow should be bootstrap glyphicon icon:

I really don\'t know how to make this using bootstrap. I was trying

相关标签:
2条回答
  • 2020-12-21 00:44

    You can achieve it by using .input-group and .input-group-addon classes of bootstrap. You can hide down arrow by using below css code in your stylesheet. Below is the code snippet :

    select {
      -webkit-appearance: none;
      -moz-appearance: none;
      text-indent: 1px;
      text-overflow: '';
    }
    <div class="input-group">
    
      <select class="form-control">
        <option>1</option>
        <option>2</option>
        <option>3</option>
      </select>
      <span class="input-group-btn"><i class="glyphicon glyphicon-menu-down"></i></span>
    </div>

    0 讨论(0)
  • 2020-12-21 00:54

    Only add pointer-events:none; to .select-side. This prevent mouse events in this div and you do click in the select behind:

    http://codepen.io/blonfu/pen/EyyPpJ

    0 讨论(0)
提交回复
热议问题