CSS for DropDownlist
-
I have dropdown lsit on my web page. <asp:DropDownList ID="ddlFrom" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFrom_SelectedIndexChanged"> </asp:DropDownList> 1)I want to change scrll bar color of the dropdownlist. 2)selected item color change. want to do above 2 things in CSS. i have added below code in my css file. select { font-family: Calibri; font-size: 13px; font-weight: normal; text-decoration: none; background: #FDEEF4; color: #663333; border: 1px solid; } what else i need to add in above code to achiev above 2 things??
-
I have dropdown lsit on my web page. <asp:DropDownList ID="ddlFrom" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFrom_SelectedIndexChanged"> </asp:DropDownList> 1)I want to change scrll bar color of the dropdownlist. 2)selected item color change. want to do above 2 things in CSS. i have added below code in my css file. select { font-family: Calibri; font-size: 13px; font-weight: normal; text-decoration: none; background: #FDEEF4; color: #663333; border: 1px solid; } what else i need to add in above code to achiev above 2 things??
-
AFAIK I don't think you can change the scroll bar color for asp:dropdownlist. ASP.NET Color DropDown Control[^] might help you.
Thanks for the reply. but i want to user asp.net controls.. link which you have provided , in which they have used another controls :( so any other wayout??
-
Thanks for the reply. but i want to user asp.net controls.. link which you have provided , in which they have used another controls :( so any other wayout??
You can download the dlls and you could use that control in the link mentioned above. 0)If you want only asp:DropDownList then I doubt you can change the color of arrow. 1)To change the color of the selected item
//changes the selected list item color
DropDownList1.SelectedItem.Attributes.Add("style", "color:Black; background:Orange;");
//changes the background color of DropDownList
DropDownList1.Attributes.Add("style", "color:Black; background:Orange;"); -
I have dropdown lsit on my web page. <asp:DropDownList ID="ddlFrom" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFrom_SelectedIndexChanged"> </asp:DropDownList> 1)I want to change scrll bar color of the dropdownlist. 2)selected item color change. want to do above 2 things in CSS. i have added below code in my css file. select { font-family: Calibri; font-size: 13px; font-weight: normal; text-decoration: none; background: #FDEEF4; color: #663333; border: 1px solid; } what else i need to add in above code to achiev above 2 things??
You pretty much can't with CSS. Except, maybe, and probably only in IE, you could put this in the CSS for the dropdown and see what happens: scrollbar-base-color: #1F2C4F; scrollbar-arrow-color: #55BBff; scrollbar-track-color: #5D7B9D; It works for grids, panels, and the browser itself, so it might work for dropdowns, too. With the above caveats.
It always itches for the first week or so. My Mu[sic] My Films My Windows Programs, etc.