I am trying to get css sprites to work. My image consists of two parts. The left part is black and the rigt part is white.
The code below shows the white part of the image. If i change the -40px value to 0 in #item0, it displays the both the black and the white part.
I cannot get it to just show the black part of the image. Can you spot what i am doing wrong?
<style type="text/css">
#menu-left {
width: 200px;
background-color: #73b2d6;
}
#navlist li {
list-style: none;
padding-left: 10px;
width: 190px;
}
#navlist a {
width: 150px;
height: 44px;
padding-left: 40px;
padding-top: 20px;
display: block;
width: 100px;
}
#item0 {
background: url('http://www.fabian.dk/all.png') -40px 7px no-repeat;
}
</style>
<div id="menu-left">
<ul id="navlist">
<li id="item0"><a href="#">link 1</a></li>
</ul>
</div>