Tek wrote:

I am just learning css and I have been working with adding a
background image to a cell. well really I'm reading eric meyer on css
and I find css that reads:

background: transparent url(filename).

When I do this in Dreamweaver the code doesn't show this "tranparent
url". Can someone explain why that is there and whether or not it's
significant.

I tried a search engine and it just kept bringing up code examples
without explainations. and up to this point none of my books have
this.

Thanks in advance.

Hi,

It's not really "transparent url", but you could think of it as "transparent, url(...)". What you are seeing is the shorthand way to declare all the background properties. Transparent is the background color, or in this case, no background color. That could also be, for example: red url(filename). The url(filename) refers to the background image location.

Another way to write this would be:

background-color: transparent;
background-image: url(filename);

It's always a good idea to define some sort of background color when using an image so if the browser can't find the image, it will return the color instead. This could become a problem if you had something like a black background image and white text. If the black background image couldn't be found, the browser would by default return a transparent background, and if the the element under it was white, then the user wouldn't be able to see the text.

Hopefully I didn't confuse you anymore . :-) If I did, let me know and I will try to clarify.

Hope this helps,
Matthew

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to