I am looking for styling solution to apply to HTML <select>
element (i.e. web form drop-down) as described below:
- Pure HTML5/CSS3 implementation
- No any reliance on Javascript or other scripting languages
- Cross-browsers compatibility (FF/Chrome/Safari/IE10)
Currently I'm using the following CSS3 snippet for styling <select>
element:
select {
font-size:9pt;
letter-spacing:0.07em;
color:#808080;
background:transparent;
border: solid 1px #808080;
padding:3px;
cursor:pointer;
}
select option { padding: 1px 5px 1px 3px;}
select option[selected]{ color:#303030; }
select option:nth-child(even) { background-color:#e5e5e5; }
Sample implementation: here
I would like to find out about other available 'pure CSS3' styling options to apply to the inner button (with that little downward triangle) of HTML <select>
element, i.e., its background, color, border, font properties, etc.
i had used this in one of my modules. You can try this :
Adjusting colors will do the work for you [hopefully]
So far, two CSS3 solutions exist pertinent to styling SELECT element, providing adequate level of customization and overall aesthetics. The following sample demonstrates both techniques; for the sake of simplicity/readability HTML5 and CSS3 parts are encapsulated in a single HTML5 file.
The first solution implements custom image placed on the pull-down button; the second one utilizes Unicode characters (can be any).
Both solutions are based on the use of CSS3 pseudo-classes. Working example is available here.
Note: there is some compatibility issue with Internet Explorer, but IE is going to be deprecated, thus it should not be recommended for any future dev.