Color "transparent" not working

Poru picture Poru · May 7, 2010 · Viewed 43k times · Source

I have a problem with the IE (what else?):

I generate content with CSS which has also a background-image. I looks like that:

#nav ul li:after {
    content: "--";
    position: relative;
    z-index: 99;
    background: transparent url(image.png);
    color: transparent;
}

The text color is in non-IE-browsers transparent, but in all IE browsers (IE6-IE8) it's black and you could see it. How could I make the text transparent/unvisible?

I tried already: visibility - opacity - filter - text-indent ... But none did his job right, either it disappears (with it background which I need) or the attribute doesn't apply.

Answer

Juan picture Juan · Oct 20, 2011

if what you're trying to do is show the image as background and not showing the text use

font-size:0px

it works!