Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to add Stylesheets to the select tag (combo box) in html

Posted on 2004-11-19
6
Medium Priority
?
307 Views
Last Modified: 2010-04-17
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
0
Comment
Question by:mohan21_kumar
  • 2
4 Comments
 
LVL 8

Expert Comment

by:edkim80
ID: 12625460
if you are using <select class="cmbBox"> your style should be of the form element.class i.e.

select.cmbBox {
etc etc.
}

Regards,
Ed
0
 

Expert Comment

by:nwalex
ID: 12625927
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
0
 
LVL 1

Author Comment

by:mohan21_kumar
ID: 12632233
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>
0
 

Accepted Solution

by:
nwalex earned 80 total points
ID: 12633427
If you look at this page (http://www.experts-exchange.com/Web/Web_Languages/CSS/Q_20828322.html) it suggests that you can't change the border of a 'select' box.

neill
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question