Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何制作带有小图像的下拉菜单? 细节 我想在我的下拉菜单左边加一个小旗 我不确定这方面的最佳做法是什么。 这是我试过的_Php_Jquery_Css_Html - Fatal编程技术网

Php 如何制作带有小图像的下拉菜单? 细节 我想在我的下拉菜单左边加一个小旗 我不确定这方面的最佳做法是什么。 这是我试过的

Php 如何制作带有小图像的下拉菜单? 细节 我想在我的下拉菜单左边加一个小旗 我不确定这方面的最佳做法是什么。 这是我试过的,php,jquery,css,html,Php,Jquery,Css,Html,她是我现在拥有的抱歉,但无法在 您最好的选择是使用带元素的,并构建类似于select的功能,但使用其他元素构建 类似于 <ul> <li><img src="your image here" />some test here</li> <!-- or use css or a font icon for cleaner mark up --> </ul> 然后用javascript绑定一些鼠标事件,因为您

她是我现在拥有的

抱歉,但无法在

您最好的选择是使用带元素的,并构建类似于select的功能,但使用其他元素构建

类似于

<ul>
    <li><img src="your image here" />some test here</li> 
    <!-- or use css or a font icon for cleaner mark up -->
</ul>

然后用javascript绑定一些鼠标事件

,因为您的select已经有了一个包含类,所以您可以这样做:

HTML:


看看Jquery UI:


这就是你需要的:

如果你有任何建议,我愿意接受。我只是想把这件事做完。
<ul>
    <li><img src="your image here" />some test here</li> 
    <!-- or use css or a font icon for cleaner mark up -->
</ul>
<div>
    <select>
        <option>1</option>
        <option>2</option>
    </select>
</div>
select,
option {
    width: 200px;}

div:before {
    content: '';
    display:inline-block;
    width: 18px;
    height: 18px;
    background-image: url('yourImageHere.png');}