Home  >  Article  >  Web Front-end  >  【】Problem with adding icon to drop-down box_html/css_WEB-ITnose

【】Problem with adding icon to drop-down box_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:48:531393browse

Now we need to add an icon to the drop-down box. The code is as follows

<select class="selectpicker show-tick">    <option class="icon-heart" value="icon-heart"> icon-heart</option>    <option class="icon-star" value="icon-star"> icon-star</option>    <option class="icon-film" value="icon-film"> icon-film</option>    <option class="icon-file" value="icon-file"> icon-file</option> </select>

The bootstrap select control is used, and the display effect is as follows:

Now this is why the drop-down appears after the first selection. Can't it be displayed in the box?

ps: The desired effect is (this mouse can display the selected one when clicking elsewhere):


Reply Discussion (Solution)

I have solved this problem. The solution is to add a color to the font of the drop-down box

<style type="text/css">    .special {        color: #808080 !important;    }</style>

That’s it.

The poster here Is it the rhythm of asking and answering questions? It is also very easy to implement without controls.

Is this the time for the poster to ask and answer his own questions? It is also very easy to implement without controls.


Isn’t the key point that no one answered? Also, how to implement this without controls?

js mouse events can be solved

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn