use a sprite png in li-class and display in div
Posted
by
bonny
on Stack Overflow
See other posts from Stack Overflow
or by bonny
Published on 2012-12-16T23:00:20Z
Indexed on
2012/12/16
23:03 UTC
Read the original article
Hit count: 201
hello i have some problem with displaying a sprite in a div that is in a li-class.
so the structure is:
<li id="aa">
<div><a href="#">one</a></div>
</li>
and the css:
li{
width: 120px;
height: 18px;
margin-top: 5px;
}
li div{
width: 20px;
height: 10px;
background-image:url(../images/sprite.png)
background-repeat: no-repeat;
margin-left: 0px;
font-weight:bolder;
border: 1px solid #fff;
}
when i use this i can see the sprite even outside the div. so i tried adding to li
background-image: none;
that makes the image in the div not visible too.
so if there is someone who know about that i really would appreciate.
thanks alot.
© Stack Overflow or respective owner