hi,how can i set a transparent background for selectbox?

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

hi,how can i set a transparent background for selectbox?

Postby mekha » Wed Aug 08, 2012 6:23 am

hi,how can i set a transparent background for selectbox?
thanks
mekha
Forum Contributor
 
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

Re: hi,how can i set a transparent background for selectbox?

Postby Christopher » Wed Aug 08, 2012 1:00 pm

If you mean inside the select box, then you will need to implement it yourself. The select is rendered differently by different browsers.
(#10850)
User avatar
Christopher
Site Administrator
 
Posts: 12681
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: hi,how can i set a transparent background for selectbox?

Postby social_experiment » Thu Aug 09, 2012 3:38 am

You can use the css below but there is a catch
Syntax: [ Download ] [ Hide ]
        select {
                background-color: rgba(255, 0, 0, 0.5);
        }
 

As Christopher mentioned different browsers render elements differently so the declaration above will work for IE9 and FF but Chrome will only make the dropdown section's background transparent. Also remember that the above will probably not work prior to IE9 so you may need to use an image for that purpose in an IE-only stylesheet.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
social_experiment
DevNet Master
 
Posts: 2775
Joined: Sun Feb 15, 2009 12:08 pm
Location: .za


Return to HTML, CSS and other UI Design Technologies

Who is online

Users browsing this forum: No registered users and 1 guest