Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. CSS for DropDownlist

CSS for DropDownlist

Scheduled Pinned Locked Moved Web Development
csssysadminarchitecturequestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mugdha_Aditya
    wrote on last edited by
    #1

    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??

    M G 2 Replies Last reply
    0
    • M Mugdha_Aditya

      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??

      M Offline
      M Offline
      m dhu
      wrote on last edited by
      #2

      AFAIK I don't think you can change the scroll bar color for asp:dropdownlist. ASP.NET Color DropDown Control[^] might help you.

      M 1 Reply Last reply
      0
      • M m dhu

        AFAIK I don't think you can change the scroll bar color for asp:dropdownlist. ASP.NET Color DropDown Control[^] might help you.

        M Offline
        M Offline
        Mugdha_Aditya
        wrote on last edited by
        #3

        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??

        M 1 Reply Last reply
        0
        • M Mugdha_Aditya

          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??

          M Offline
          M Offline
          m dhu
          wrote on last edited by
          #4

          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;");

          1 Reply Last reply
          0
          • M Mugdha_Aditya

            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??

            G Offline
            G Offline
            GenJerDan
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups