3

Bootstrap 4 select option to added image thumbnail not working, any solution for this?

Thanks

 <select class="form-control" id="exampleFormControlSelect1">
          <option><img src="/assets/images/platform/abs.png">ABS-01</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
        </select>
core114
  • 5,155
  • 16
  • 92
  • 189

2 Answers2

4

You cannot add icons or images in select. But a plugin called bootstrap-select can help you.

The icons used for this plugin are directly loaded from the Glyphicons provided by bootstrap.

The Git Project can be found here: https://github.com/snapappointments/bootstrap-select

You can also find a live demo of the functionality in here: http://silviomoreto.github.io/bootstrap-select

jox
  • 2,218
  • 22
  • 32
Kevin
  • 1,241
  • 7
  • 20
0

Try using this

<select title="" class="selectpicker">
    <option>Select...</option>
    <option data-content="<img class='email' src='https://thdoan.github.io/bootstrap-select/images/icon-chrome.png'><span class='text-dark'>Air India Express</span>"> Chrome</option>
    <option data-content="<img class='email' src='https://thdoan.github.io/bootstrap-select/images/icon-firefox.png'><span class='text-dark'>Air India Express</span>"> Firefox</option>
    <option data-content="<img class='email' src='https://thdoan.github.io/bootstrap-select/images/icon-ie.png'><span class='text-dark'>Air India Express</span>"> IE</option>
    <option data-content="<img class='email' src='https://thdoan.github.io/bootstrap-select/images/icon-safari.png'><span class='text-dark'>Air India Express</span>"> Safari </option>
</select>
Bhushan wagh
  • 187
  • 1
  • 14