Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macjram

macrumors 6502a
Original poster
Dec 20, 2008
574
3
RESOLVED

I want to set up a translucent div in the background of my blog so that the content will appear to "lay" on top of the translucent div that goes all the way from the top of the page to the bottom fo the page.

http://mfjram.com/wp/

heres the code I have

<div id="translucent">

</div>

before </body>

and my css is

#translucent {
width: 700px ;
height: 100% ;
background-color:#fff;
position:absolute;
top:0;
margin-left: auto ;
margin-right: auto ;
filter:alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}
 
Using opacity will cause the entire contents to become transparent, not just the background. You can use rgba to do just the background,
Code:
#translucent {
 background: rgba(0, 0, 0, .6);
}
Though IE doesn't yet understand this. An alternative is to create a small png image that has the transparency you want and place it as the background image. This will require you to use one of the IE fixes for transparent pngs though. IE will slow you down no matter what way you take.
 
I hella forgot about transparent pngs hahah, thanks !

Also, do you know how I can expand a div but have it remain in the center of the page?

edit; Resolved !

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.