bonny
bonny

Reputation: 3247

use a sprite png in li-class and display in div

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 this 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.

Upvotes: 0

Views: 313

Answers (1)

dev
dev

Reputation: 3999

It seems you are missing a ; after background-image please see below

background-image:url(../images/sprite.png);

Upvotes: 2

Related Questions