Web Hosting Talk







View Full Version : css - background question


Draco
12-20-2005, 08:44 PM
helo there
I've got this question about using backgrounds with css
the thing is I have this menu where the name of each category is an image, for example:

Categories >>> an image
1. music
2. tech
New >>> another image

and so on.

On my html code I use a div for each part where the image supposted to be,like

<div id="categories">
</div>

(its empty tho)

and then on css

#categories
{
background-image: etc etc etc
}


is that correct? because it doesn't seem to be working for me

thanks in advance for any help

JoeLloyd
12-20-2005, 10:34 PM
background-image: url(images/images.jpg);

Draco
12-20-2005, 11:20 PM
I just figured one thing, I needed to add some other declarations in order the image to show up, not just the background-imagen url, but thank joe :D

the_pm
12-21-2005, 10:56 AM
Empty containers of any kind are not advisable, since browsers sometimes interpret them unpredictably.

I would advise you to use a transparent spacer image to hold open those divs. Make it the same dimension of each background image. Then, apply alternative text to it matching the categories shown in the images. This way, when someone browses your site with images disabled, they can still have a meaningful browsing experience, and your divs should act much more predictably as well.