Very Basic!
1 2 3 4 5 6 7 8 9 10 11 12 13 |
select option { margin:2px; background-color:#8BC53F; color:#fff; } //maybe this also .select-box select:focus { outline: none; background: #000; color: #fff; } |
or this
Or this with no image used!
Best way is to use this plugin (SelectBoxIt)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css"> <script type='text/javascript' src="http://gfranko.github.com/javascripts/jQuery.selectBoxIt.min.js"></script> <style type='text/css'> /* * jQuery.selectBoxIt.css 0.1.0 * Author: @gregfranko */ /* div surrounding the Select Box */ #testSelectBoxItContainer { display: inline-block; *display: inline; zoom: 1; } /* Select Box */ #testSelectBoxIt { height: 30px; /* Height of the select box */ cursor:pointer; white-space:nowrap; /* Provide a background image here if you want to use an image for the down arrow */ } /* Select Box and Select Box Options */ #testSelectBoxIt, #testSelectBoxItOptions { width: 220px; /* Width of the select box and select box options*/ } /* Select Box Text */ #testSelectBoxItText { font: 14px Helvetica, Arial; text-indent: 5px; line-height: 30px; overflow:hidden; float:left; white-space:nowrap; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: -moz-none; ms-user-select: none; -o-user-select: none; user-select: none; } /* Select Box Options List*/ #testSelectBoxItOptions { max-height: 180px; /* A vertical scrollbar appears if your select box options are taller than this */ font: 14px Helvetica, Arial; margin:0; padding:0; list-style:none; position:absolute; overflow:auto; cursor:pointer; display:none; z-index:99999; outline:none; } /* Select Box Individual Options */ #testSelectBoxItOptions li { line-height: 30px; /* Height of Individual Select Box Options */ text-indent: 5px; /* Horizontal Positioning of the select box option text */ overflow:hidden; white-space:nowrap; } /* Select Box Down Arrow Container (if an image is not used) */ #testSelectBoxItArrowContainer { width: 30px; /* Positions the down arrow */ float:right; } /* Select Box Down Arrow */ #testSelectBoxItArrow { /* Horizontally centers the down arrow */ margin-right:auto; margin-left:auto; } /*Prevents the blue selection background from showing up on webkit*/ *::selection { background:transparent; } </style> <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ var selectBox = $("select#test").selectBoxIt().data("selectBoxIt"); });//]]> </script> <select id="test" name="test"> <option value="Terrible" disabled="disabled">Terrible</option> <option value="Not Bad">Not Bad</option> <option value="Good" selected="selected">Good</option> <option value="Great">Great</option> <option value="Amazing">Amazing</option> </select> |