...Technology Simplified

Wednesday, May 30, 2012

Insert an image in select control

No comments :
 
select#colormenu option[value="Red"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select#colormenu option[value="Green"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select#colormenu option[value="Blue"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select.icon-menu option
{
background-repeat:no-repeat;
background-position:bottom left;
padding:0px 0px 0px 20px;
}


<select  id="colormenu" class="icon-menu">
<option value="none">Select color</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
</select>


clip_image001



But one issue with this code is it doesnt work on all browsers , but still it doesnt mess up the design..

No comments :

Post a Comment