Forum Moderators: phranque

Message Too Old, No Replies

Opaque table background

Can it be done with a PNG or CSS?

         

hondafox400

2:35 am on Jan 25, 2004 (gmt 0)

10+ Year Member



Hey,

Is there any way to make a table background partially tranparent? Like to have the opacity be 50% for example. I have heard this is possible with a PNG, but I don't know how. Or, is there any way to make only the table background opaque with CSS, but leave the text and stuff at full opacity?

isitreal

10:06 pm on Jan 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, this will work in IE >=4, Mozilla, but not Opera, probably not Safari:

<html>
<head>
<title></title>
<style type="text/css">
.container {background-color:green; -moz-opacity: 0.35; filter: alpha(opacity=35); height:200px;}
h1 {color:red; -moz-opacity:0.4; filter: alpha(opacity=40);}
</style>
</head>
<body>
<div class="container">
<h1>
testing
</h1>
</div>
</body>
</html>

The 'filter' takes care of IE windows, the -moz-opacity handles Mozilla.

This seems to work fairly well, for better info search google: opacity css