without editing a background image for my web page in photoshop is there code to change the opacity of the background image, if so can u post the code and where to put it in my html document? gracias:)
Printable View
without editing a background image for my web page in photoshop is there code to change the opacity of the background image, if so can u post the code and where to put it in my html document? gracias:)
CSS can kinda do this..HTML Code:<html>
<head>
<style>
div {
background-image:url(forest.jpg);
filter:alpha(opacity=20);
height:100%;
opacity:.90;
}
</style>
</head>
<body>
<div>some text here</div>
<img src="forest.jpg">
</body>
</html>
I think Opacity is one of those things that isn't supported very well.. across all browsers (not sure if IE supports it at all)
You can't appear to specify an opacity for a page background (so <body background="url"> won't work), but if you wrap your page in a Div, you can set the opacity to the div and it should work (see my little test code as an example). I think you need to use opacity and filter, as IE understands filter (apparently) and FireFox seems to understand opacity... I dunno, have a read and see what you come up with
Heres a great article for you read up on it
http://www.mandarindesign.com/opacity.html
CB will be able to answer this better I'm sure :p
http://www.standards.spiralmindsinc..../css-testcase/
Demonstration of CSS opacity, among other things.
PcM is correct, IE uses filter (which is proprietary) and standards-compliant browsers recognise the opacity property.
Bear in mind that there is no "background opacity" as such. Opacity applies to an element and all its children. So if you want background opacity without child element opacity I suppose you would have to make the semi-translucent element and then overlay another non-translucent element (with no background) over that.
Or use a partially transparent PNG as background. Of course, that again requires you to use an IE filter, because otherwise the PNG isn't loaded properly.