简体   繁体   English

如何将图片和文本放入HTML选择标签

[英]How I do I put images as well as text into Html select tag

I currently have a button for each language to allow users to view website in difference languages 我目前对每种语言都有一个按钮,以允许用户查看不同语言的网站

<a href="http://www.jthink.net/songkong/en" title='English'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/GB.png" alt="English" height="32" width="32" valign="top"></a>&nbsp;
<a href="http://www.jthink.net/songkong/de" title='Deutsch'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/DE.png" alt="Deutsch" height="32" width="32"  valign="top"></a>&nbsp;
<a href="http://www.jthink.net/songkong/es" title='Español'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/ES.png" alt="Español" height="32" width="32"  valign="top"></a>&nbsp;
<a href="http://www.jthink.net/songkong/fr" title='Français'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/FR.png" alt="Français" height="32" width="32"  valign="top"></a>&nbsp;

I now want to use a drop down to save space, but how do I output the flag image as well as the text in the options, currently I have 我现在想使用下拉菜单来节省空间,但是如何输出标志图像以及选项中的文本,目前我有

<select>
  <option value="en">English</option>
  <option value="de">Deutsch</option>
  <option value="es">Español</option>
  <option value="fr">Français</option>
</select> 

You can't have any HTML in option tag, but you can use background-image in CSS. option标签中不能包含任何HTML,但可以在CSS中使用background-image See this: How to add a images in select list . 请参见: 如何在选择列表中添加图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM