Possible Duplicate:
CSS Select Selector
What is the CSS equivalent to the following when dealing with select lists?
input[type="text"]
input[type="submit"]
Possible Duplicate:
CSS Select Selector
What is the CSS equivalent to the following when dealing with select lists?
input[type="text"]
input[type="submit"]
The input[type="text"]
CSS selector can be broken down into;
input
; find all elements that are input
elements.[type="text"]
; filter those elements by those which have the type
attribute of text
.Because a select box is a <select>
element rather than a <input type="select" />
, you can just use the select
selector as follows;
select {
/* blah blah blah*/
}
select is not a type of input like those in your example, so you cannot use an attribute selector when you target a select
As Fabrizio-Calderan says, select does not have a type property. however, you could use the data-property and style your element based on this
see here : Select elements by data attribute in CSS
Why not using a class to style it?
Pseudo code:
<select>
<option class="wise">
<option class="not-so-wise">
<option class="meh">
</select>
select {
border:1px solid green;
}
select option {
font-weight:bold;
}
select