View Full Version : css, non-repeating background image


ckirchho
06-16-2009, 08:50 AM
Hello,

if I for example realize special list bullets by attaching a non-repeating background image to each list item of a list, then I have a display problem in ADE and Sony Reader.

When a list bullet goes over to the next page, then on that next page the background image is repeated again, letting it look - in this case - as if another list item starts, while in reality the actual list item is just continued.

This would apply to other elements that go over to the next page and have a non-repeating background image.

Would there be any way to correct this?

An alternative - as far as I see - would be to insert a specially classified span at the beginning of each item, and to define a background only for that span.

Best regards,

Christian Kirchhoff

Jellby
06-16-2009, 08:59 AM
An alternative - as far as I see - would be to insert a specially classified span at the beginning of each item, and to define a background only for that span.

I would do that, or include the image as kind of float with no real height/width.

frabjous
06-19-2009, 11:24 AM
Hello,

if I for example realize special list bullets by attaching a non-repeating background image to each list item of a list, then I have a display problem in ADE and Sony Reader.

Why not just use the list-style-image property? E.g., put this in your CSS style sheet:


ul
{
list-style-image:url("mybullet.gif");
}

More info here (http://www.w3schools.com/css/pr_list-style-image.asp).

I haven't checked how that looks in ADE or Sony Reader, but it seems like more "proper" CSS than using a non-repeating background image.

ckirchho
06-26-2009, 04:35 AM
I didn't want to do that because of what is said in the following article:
http://css.maxdesign.com.au/listutorial/introduction.htm

"HTML bullets can be replaced with graphic images using "list-style-image". However, the placement of these images is inconsistent across most modern browsers. There is also very little control over how the bullets appear beside the list items."

That's why I almost always use non-repeating background images.

Best regards,

Christian