How do I change the BackColor of the textbox area in an asp.net DropDownList from white to another color? The Backcolor property changes only the drop down section.
views:
33answers:
2
+5
A:
You can change the background color of a tag with the following:
select {
background-color: #ff0000;
border: 1px solid #ff0000; /* if you want a different border */
}
Note: IE's styling differs from Firefox though.
Neurofluxation
2010-05-26 15:31:27
+1
A:
You can do this via an external stylesheet and target the DropDownList's ID, or you can add the CSS property via code, like so:
DropDownList.Attributes.Add("style", "background-color: #FF0000")
But as Nick pointed out, you may not get your desired result, because form elements inherit from native operating system controls.
Intelekshual
2010-05-26 15:32:11
I think it's only fair that I vote you up - you covered the other direction :)
Neurofluxation
2010-05-26 15:37:25