I've set a wrapper DIV to 0.4 opacity, how do I prevent the opacity of any content?
Thanks in advance
I've set a wrapper DIV to 0.4 opacity, how do I prevent the opacity of any content?
Thanks in advance
Last edited by jscheuer1; 05-08-2012 at 03:39 AM.
Hi there Burgin,
try it with "rgba()"...
cootheadCode:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="language" content="english"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <style type="text/css"> #box { width:324px; line-height:200px; border:1px solid #000; margin:24px auto 0; font-family:verdana,sans-serif; font-size:28px; font-weight:bold; text-align:center; color:rgb(255,0,0); background-color:rgba(255,0,0,0.4); } </style> </head> <body> <div id="box">opacity test</div> </body> </html>
Burgin (04-09-2012)
to clarify,
opacityapplies to an element and all of its content (all child elements and text). it's supposed to work this way; you can't "prevent" it.
if you only want the background to be semi-transparent, use anrgbavalue for the element'sbackground, as coothead suggests.
Burgin (04-09-2012)
@traq @coothead... Thanks, that's beautiful.
No problem, you're very welcome.
coothead
Bookmarks