Php 如何制作带有小图像的下拉菜单? 细节 我想在我的下拉菜单左边加一个小旗 我不确定这方面的最佳做法是什么。 这是我试过的
她是我现在拥有的抱歉,但无法在 您最好的选择是使用带元素的,并构建类似于select的功能,但使用其他元素构建 类似于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绑定一些鼠标事件,因为您
<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');}