Grow your CSS skills. Land your dream job.

How to apply background color to first item in a Select Box form? (No Javascript)

  • # February 14, 2013 at 12:26 am

    Here is an example code:
    http://jsfiddle.net/UBkVg/

    I am trying to set the background-color of the form control selection box to be something other than white. Is it possible to do with CSS?

    # February 14, 2013 at 12:55 am

    @FatStraw http://jsfiddle.net/JhE79/

    # February 14, 2013 at 12:58 am

    omg. I feel like a newb now. How did I miss that??? I literally spent an hour trying to find css hacks and messing around with pseudo classes/elements trying to get the background to show up lol!

    Thanks!!!

    # February 14, 2013 at 1:06 am

    @FatStraw You’re welcome. I think I got that code backwards so here is an update: http://jsfiddle.net/JhE79/1.

    # February 14, 2013 at 1:09 am

    I kept trying to make changes to the “selection option” part but never tried to do it with just “selection”. :(

    Thanks again for the help

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".