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

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

Moderator: General Moderators

Post Reply
mekha
Forum Contributor
Posts: 112
Joined: Sat Mar 31, 2012 6:50 am

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

Post by mekha »

hi,how can i set a transparent background for selectbox?
thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

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
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

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

Post by social_experiment »

You can use the css below but there is a catch

Code: Select all

	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
Post Reply