option background-color: #3CB371;color: #ffffff;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Styled menu items</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style>
input.txt {
color: #00008B;
background-color: #E3F2F7;
border: 1px inset #00008B;
width: 200px;
}
input.btn {
color: #00008B;
background-color: #ADD8E6;
border: 1px outset #00008B;
}
form div {
clear: left;
margin: 0;
padding: 0;
padding-top: 0.5em;
}
form div label {
float: left;
width: 40%;
font: bold 0.9em Arial, Helvetica, sans-serif;
}
option[value="blue"] {
background-color: #ADD8E6;
color: #000000;
}
option[value="red"] {
background-color: #E20A0A;
color: #ffffff;
}
option.green {
background-color: #3CB371;
color: #ffffff;
}
option.yellow {
background-color: #FFF280;
color: #000000;
}
</style>
</head>
<body>
<form method="post" action="">
<div>
<label for="color">Select your favorite color:</label>
<select name="color" id="color">
<option value="">Select One</option>
<option value="blue" class="blue">blue</option>
<option value="red" class="red">red</option>
<option value="green" class="green">green</option>
<option value="yellow" class="yellow">yellow</option>
</select>
</div>
<div>
<input type="submit" name="btnSubmit" id="btnSubmit" value="Send!" class="btn" />
</div>
</form>
</body>
</html>
Related examples in the same category