开发者

Style UL with Sprite Image

开发者 https://www.devze.com 2023-01-30 10:28 出处:网络
Wondering if开发者_Python百科 it is possibly to use a sprite image to replace the ul list default bullet. Is this possible?Lists have the list-style-image property, but it is often too inflexible.

Wondering if开发者_Python百科 it is possibly to use a sprite image to replace the ul list default bullet. Is this possible?


Lists have the list-style-image property, but it is often too inflexible.

You can usually get it working with something like this...

ul {
   list-style: none;
}

ul li {
   padding: 3px 0 3px 35px;
   background: url(images/layout/bullet.png) no-repeat left center;
}

A sprite is not generally a good idea for this - unless you space them all vertically and allow sufficiently enough vertical margins so the list item doesn't grow too large and have other sprites bleed through.


ya sure its possible

first you remove the bullet style for the li tag

list-style:none;

Then give background-image for the li tag

0

精彩评论

暂无评论...
验证码 换一张
取 消