Click to See Complete Forum and Search --> : Firefox backgroung image on span


cluettr
07-25-2007, 03:05 PM
What is it that I am missing in order to make the background of a span appear in firefox? It appears correctly in IE.

<span style="width:543px;height:64px;background-color: black;background-image: url(_images/banner_left.gif);background-position:left bottom;">
</span>

Centauri
07-25-2007, 05:17 PM
Inline elements, such as spans, cannot be given a width and height. If this is required to just display the image, either convert it to a block element using display:block or float, or use a div. If a block level element cannot be used in your situation, wide padding or borders assigned to the span may bring it to the desired size.

WebJoel
07-25-2007, 05:57 PM
background-image: url(_images/banner_left.gif)

Does this even work at all? "underscore" starting a file-name or folder-name doesn't seem to work for me on my computer.. :confused:

cluettr
07-25-2007, 06:47 PM
Thank you so much I understand.

One question you or someone else may be able to answer. If I wanted to generate three blocks that were side by side within a containing block what is the best way to do it? As you can see I have been doing it with spans because it naturally allows the content within it to sit side by side with the content next to it. Block level elements do not allow you to do that, they always appear one on top of the other.

Centauri
07-25-2007, 09:43 PM
float:left

cluettr
07-26-2007, 07:02 PM
Thank you! : )