EDIT 2015 May
Disclaimer: I took a snippet from the answer below:
Important update!
In addition to WebKit, with Firefox 35 , we can use the appearance property
Using -moz-appearance with a value of none in the combo box, remove the drop down button
So now, to hide the default style, itβs just as easy to add the following rules to our select element:
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; }
To support IE 11, you can use [ ::-ms-expand ] [15].
select::-ms-expand { display: none; }
Old answer
Unfortunately, what you are asking for is not possible using pure CSS. However, here is something similar that you can choose as a job. Check out the code below.
div { margin: 10px; padding: 10px; border: 2px solid purple; width: 200px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } div > ul { display: none; } div:hover > ul {display: block; background: #f9f9f9; border-top: 1px solid purple;} div:hover > ul > li { padding: 5px; border-bottom: 1px solid #4f4f4f;} div:hover > ul > li:hover { background: white;} div:hover > ul > li:hover > a { color: red; }
<div> Select <ul> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 3</a></li> </ul> </div>
EDIT
Here is a question you asked a while ago. How to style a <select> dropdown with CSS only without JavaScript? As they say, only in Chrome and to some extent in Firefox can you achieve what you want. Otherwise, unfortunately, there is no transparent CSS solution with a cross browser to style the selection.
Savas Vedova Dec 08 '11 at 12:36 2011-12-08 12:36
source share