I have a div set transparent with rgba and want the div to share an input field that also has a transparent background. The problem is that the background of the input field does not display transparently. It works if I use opacity:0.8;
in a div, but also transparent text, so I need rgba
. For the second input field, which is outside the rgba
transparent div, it works.
Here is my sample code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Insert title here</title> <style type="text/css"> .term { background-color: rgba(0,0,0,0.8); color: #5fba3d; width: 200px; height: 100px; } input { background-color: rgba(0,0,0,0.8); color: #FFF; border: none; } </style> </head> <body> <div style="background-color:yellow; width:300px;"> <div class="term"> Input 1 <input type="text" value="Test" /> </div> <br /> <input type="text" value="Input 2" /> </div> </body> </html>
Any ideas?
Thanks!
Nathanael
source share