Is it possible to add a small image into the <select> <option> tag in HTML?
I want to add a small image as selections instead of text, is there a way to accomplish this?
Status:
Open Mar 18, 2007 - 12:36 PM
html, Option Tag, Select Tag, images, Adding Images
9answers
Answers
Apr 12, 2007 - 03:16 AM
Interesting question. Ive not seen anything like that. The only thing Ive done before is to show an image based on a selection (javascript).
Not sure from what u ask, if its possible using DHTML
Apr 12, 2007 - 04:12 AM
Yeah, not really what I wanted but close. So there is no way to do it with the normal tags?
Apr 12, 2007 - 04:34 AM
I'll have a dig around, see what I can come up but Ive never come across this before
May 07, 2007 - 04:44 AM
I'm assuming that this cant be done. Thanks for the DHTML version.
May 07, 2007 - 09:30 AM
Yea, Im sorry, I couldnt find a way of doing it, hence no response from me.
Oct 22, 2008 - 08:01 AM
Though it is possible in Mozilla, but IE doesn't support it :(
Your text here
Any body have some comments about IE??
Mar 02, 2009 - 05:12 AM
Hi, u can use classes specifics for each flag in tag option, exemple: BRASIL, and declare the details for your background (color, image, image-position).I used just one image content all flags around world and I specificied just the background position, in css file:
option.flag[value="br"]{ background-image: url(../imagens/flags.gif);background-repeat: no-repeat;background-attachment: scroll;option.br{background-position:0 -277px;}
much moore easy to update;
Dec 20, 2019 - 03:21 AM
It is not possible the way you mention. You'll have to try another method.
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment