在选择选项中显示图像 [英] Display image in select option

查看:41
本文介绍了在选择选项中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中的图像很小,想在选择选项中显示它.

I have small image in my project and want to display it in select option.

<select>
  <option>random text</option>  -->There should be also an image
</select>

推荐答案

< option> 元素唯一允许的内容是文本.

The only permitted contents for an <option> element is text.

Content categories: None.
Permitted content:  Text, possibly with escaped characters (like &eacute;).
Tag omission:       The start tag is mandatory. The end tag is optional if this element is immediately followed by another <option> element or an <optgroup>, or if the parent element has no more content.
Permitted parents:  A <select>, an <optgroup> or a <datalist> element.
Permitted ARIA roles:   None
DOM interface:      HTMLOptionElement 

有关更多信息,请参见

这篇关于在选择选项中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆