HTML & CSS help

Post » Sat Feb 19, 2011 4:47 am

I am working on a website for a project, and I have a picture for the website background. I put a table over the picture and I want the table background to be transparent, no 100% transparent, but about 50%. Much like how the forum is, with the picture in the background and the somewhat transparent box over it.

Everything I have tried has either not worked, or has made the text transparent as well. I want the text to stay at full visibility. Is this possible?

Can someone with HTML and CSS knowledge please help me.
User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Sat Feb 19, 2011 7:05 am

Use a transparent image? If it is a colour you can maybe use rgba (standing for red green blue alpha). Something like this would give you a 50% transparent red background.

background-color: rgba(255,0,0,.5);


Watch browsers that support this though. I am not sure which do, and of those that do it is probably only the recent ones. For older ones you would need to implement a fallback background.
User avatar
Shannon Lockwood
 
Posts: 3373
Joined: Wed Aug 08, 2007 12:38 pm

Post » Sat Feb 19, 2011 7:09 am

Thank you, that worked like a charm. We are just doing this for a school project, and aren't going to publish them. So fallback backgrounds aren't necessary in this case, but I will remember that for the future.
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Sat Feb 19, 2011 10:41 am

Watch browsers that support this though. I am not sure which do, and of those that do it is probably only the recent ones. For older ones you would need to implement a fallback background.

Internet Explorer 9 is the first IE to support rpga so I'd use a fallback background just to be sure since IE 8 (and older versions) would have problems with it. (http://css-tricks.com/rgba-browser-support/)
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm


Return to Othor Games