Change color of selection in select option - HTML CSS CSS Form

HTML CSS examples for CSS Form:input select

Description

Change color of selection in select option

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

select{<!-- w  w w . jav  a  2s.  c  o  m-->
   margin:40px;
   background: yellow;
   color:#000;
   text-shadow:0 1px 0 rgba(0,0,0,0.4);
}
option:not(:checked) {
   background-color: #FFF;
}


      </style> 
 </head> 
 <body> 
  <select> 
     <option val="">Select Option</option> 
     <option val="1">Option 1</option> 
     <option val="2">Option 2</option> 
     <option val="3">Option 3</option> 
     <option val="4">Option 4</option> 
  </select>  
 </body>
</html>

Related Tutorials