mohan21_kumar
asked on
How to add Stylesheets to the select tag (combo box) in html
Hi,
I'm using the following code to add the styles to the combo box but it is not getting reflected suggest me how to add the styles to the combo boc
The code which i have used is as follows :
<html>
<style type="text/css">
cmbBox {
background-color: navy;
border: black 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 18pt;
font-weight: normal
}
</style>
then..
<body>
<select class="cmbBox">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
But in the above code the style is not getting reflected
Suggest me how to add the style to the combo or give me some sample examples which would meet my requirements
Thanx
I'm using the following code to add the styles to the combo box but it is not getting reflected suggest me how to add the styles to the combo boc
The code which i have used is as follows :
<html>
<style type="text/css">
cmbBox {
background-color: navy;
border: black 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 18pt;
font-weight: normal
}
</style>
then..
<body>
<select class="cmbBox">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
But in the above code the style is not getting reflected
Suggest me how to add the style to the combo or give me some sample examples which would meet my requirements
Thanx
Note the '.' in front of cmbBox:
.cmbBox {
background-color: navy;
border: black 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 18pt;
font-weight: normal
}
neill
.cmbBox {
background-color: navy;
border: black 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 18pt;
font-weight: normal
}
neill
ASKER
after adding . to the style i'm able to get the style to the combo box but the border style is not getting suggest me how to add the style to the borders of the combo box
Code is as follows :
<html>
<style type="text/css">
.cmbBox {
background-color: white;
border: 10px solid;
BORDER-RIGHT: #000099 2px solid;
BORDER-TOP: #000099 2px solid;
BORDER-LEFT: #000099 2px solid;
BORDER-BOTTOM: #000099 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 12pt;
font-weight: normal
}
</style>
then..
<body>
<select class="cmbBox">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
Code is as follows :
<html>
<style type="text/css">
.cmbBox {
background-color: white;
border: 10px solid;
BORDER-RIGHT: #000099 2px solid;
BORDER-TOP: #000099 2px solid;
BORDER-LEFT: #000099 2px solid;
BORDER-BOTTOM: #000099 2px solid;
color: 00000;
font-family: arial, verdana, ms sans serif;
font-size: 12pt;
font-weight: normal
}
</style>
then..
<body>
<select class="cmbBox">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
select.cmbBox {
etc etc.
}
Regards,
Ed