views:

77

answers:

3

I have often seen stylesheets written where you have something like this:

#anyelement {
  background:transparent url(../img/filename.png) no-repeat left top;
}

The value in question is the "transparent" value - what is the benefit of using this value? I have never really used it with my own css files and my PNG images still seem to work fine in all browsers that support PNGs.

Can anybody shed some light on the use of this value??

Thanks!

+9  A: 

If you're inheriting a background color from another declaration then that should clear it out.

Azeem.Butt
A: 

The transparent value in this example is the background color (or lack thereof).

pygorex1
A: 

The first part of the background attribute is the background color. This is the color that is shown if the background image is not found. Transparent just means that it shouldn't show a background color. Transparent is also the default btw.

Tor Valamo