0

Hi,
I am looking to make a div tags background invisible. I don't want the text to be invisible. If I use css opacity to get it done then the whole div tag disappears. I only want the background to go.

I searched the net but there aren't any easy to find examples.

Hope someone can help me out here.


Cheers,
vishal

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Arkinder
0
<script type="text/javascript">
var bg
function ShowBackground(id){
if (document.getElementById(id).style.background==""){
bg=document.getElementById(id).getAttribute("title");
document.getElementById(id).style.background=bg;
}
function HideBackground(id){
if (document.getElementById(id).style.background!=""){
bg=document.getElementById(id).style.background;
document.getElementById("idElement").setAttribute("title", bg);
document.getElementById(id).style.background="";
}
</script>

I didn't try it yet

0

If you only want the opacity to affect the background, place the text in a separate element and position it over the background. Absolute positioning, floats, z-index, etc.


Regards, Arkinder

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.