Click to See Complete Forum and Search --> : image in css ??


mlotfi
08-15-2006, 12:13 PM
Hi I created a css file that has :
li {
list-style-image:url(\images\arrow.gif);
list-style-position: outside;
}

but when I call li in my html page I got only a black dot and not the image arrow.gif

gil davis
08-15-2006, 12:41 PM
The file name has to have quotes around it.

danadd
08-15-2006, 01:14 PM
You need the list-style:none in the ul tag. I've found this method works really well cross-browser:

ul {list-style:none; margin:0; padding:0 0 12px 40px;}
li {background:url(\images\arrow.gif) no-repeat 0 3px; padding-left:10px;}

Mess around with the padding in the ul and li as well as the positions in the li background (0 is for top, 3px is for left).

(and you don't need quotes around the image name - that's outdated.)

ray326
08-15-2006, 01:18 PM
url(/images/arrow.gif)

The web ain't Windows.

mlotfi
08-15-2006, 01:39 PM
Hi, I tried all the above, but nothing work, here is what I have :
li {
list-style-image:url(/images/arrow.gif);
list-style-position: outside;
}

ul {
margin-left: 23px;
}

thanks

gil davis
08-15-2006, 03:03 PM
Are you absolutely sure that the image is where it should be?

mlotfi
08-15-2006, 03:46 PM
I think gil Davis was right, it has to be between quotes :
list-style-image:url('images/arrow.gif');

now it works.
But I don't understan why, because when I downloaded this css file from a web site it was working without quotes :
list-style-image:url(http://..../images/arrow.gif);

WebJoel
08-15-2006, 07:55 PM
Not sure why either, but in EditPlus2 the HTML-editor, even though you CAN write a URL image as

list-style-image:url(/images/arrow.gif);

it colors the path, indicating a possible syntax or format error, but:

list-style-image:url('/images/arrow.gif');

makes the color indicate correctness, -even though either works and both validate... hmm..

ray326
08-15-2006, 09:34 PM
http://www.w3.org/TR/CSS21/syndata.html#x44

ewallace
08-16-2006, 09:29 AM
I don't use quotes for my background images and they work for me.

mlofti, I think the trick was the difference between the "/images/arrow.gif" in your first post and the "images/arrow.gif" in the gil is right post. Perhaps?