Carlo
Carlo

Reputation: 4148

non-transparent input text on transparent background

I have a form inside a div with a transparent color. I'd need to have the input texts plain white (non transparent). How can I do it?

Here's some code:

http://jsfiddle.net/d5Xuu/11/

(don't mind the background, it's just a random image I picked for the example)

Thanks

Upvotes: 2

Views: 2156

Answers (2)

Franz
Franz

Reputation: 46

If you use:

opacity: .7

of a div, his sons take the same property.
You can solve using rgba (255,255,255, .7)

http://jsfiddle.net/d5Xuu/19/

Upvotes: 1

sandeep
sandeep

Reputation: 92803

@carlo; may be you have to use use css3 rgba color for your background transparency which is not effect div child elements.

background: rgba(0,0,0,0.3)

for IE use filter

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000); /* IE 6 & 7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000)"; /* IE8 */

you can generate your rgba filter from here http://kimili.com/journal/rgba-hsla-css-generator-for-internet-explorer/

Upvotes: 2

Related Questions