-1

I try to create a search box with a dropdown inside the search text field and i want add a different image for every option

For now this is my result:

http://www.bootply.com/TqXN4y8Se5

The image are not visible, in dropdown are not possible add image?

Thanks for any help!

junkfood
  • 41
  • 1
  • 11

2 Answers2

1

the html option tag does support text only

see other pst Adding images with option tag

altough you could use bootstraps dropdown component.

http://getbootstrap.com/components/#dropdowns

altough it requires custom javascript to listen to changes and react accordingly.

<div class="dropdown">
  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
    Dropdown
    <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">Separated link</a></li>
  </ul>
</div>
Community
  • 1
  • 1
Luke
  • 8,235
  • 3
  • 22
  • 36
1

You can use a background image but it's not available cross-browser. Or you can use jquery like http://jqueryui.com/selectmenu/#custom_render

Rachel S
  • 3,780
  • 3
  • 24
  • 37