views:

945

answers:

5

Can we write custom dropdown box using javascript,html,css. and also placing backgroung-image for that.

any sample example

+2  A: 

Yes we can!

Greg
Edited the question :)
Yuval A
+1 Shouldn't up vote really but since I was about to answer the same I guess it would be hypocritical not to ;)
AnthonyWJones
I can't :(
Chad Grant
A: 

Yes. Yahoo! managed it, should you want evidence.

David Dorward
A: 

Yes, and we can too =)

Maksim Kondratyuk
A: 

Yes you can create a custom dropdown box like element.

You can use a div for this purpose and set the background-image property for that div.

You can add ul as menu items. Nut you have to write code for event like mouseclick, mouseover, mouseout, keydown etc

rahul
+1  A: 

yes you can. with css it goes like this.

add couple of class to your css page, like this:

.cmdUnbelievable
{
    width:200px;
    font-family:Trebuchet MS;
    background-color:#0b5925;
    color:#d4d5d4; 
    border:dashed 2px #f2f2f2;
}
.cmdUnbelievable option
{
    color:#f2f2f2;
    border-bottom:solid 0px white;
    border:dashed 2px #f2f2f2;
    margin-left:15px;
}

then give a class to your select box :

    <select class="cmdUnbelievable">
        <option>We are</option>
        <option>the knights</option>
        <option>who say Ni.</option>
    </select>
@kumar mentions setting a background image... FYI if you try to set one on the option elements it won't work in IE.
scunliffe