I am facing some issues while trying to use a sprite image for my navigation icons. The background position offset is not working as expected, and the background image is stretching across the whole length of the navigation. It seems like I may need to specify the width and height of the image being displayed.
Here is the code I am using: http://jsfiddle.net/spadez/737YT/1/
.navigation {
}
.navigation li {
}
.navigation li a {
background: url(http://www.otlayi.com/web_images/content/free-doc-type-sprite-icons.jpg) no-repeat left center;
display: block;
color: white;
padding-top: 15px;
padding-bottom: 15px;
margin-bottom: 5px;
margin-top: 5px;
}
.navigation li a:hover {
background-color: #495C6D;
}
.navigation li a.active {
background-color: #495C6D
}
#rss span {
background-position: -15px 0;
}
#photos span {
background-position: -30px 0;
}
#links span {
background-position: -45px 0;
}
Can someone help me figure out what I am doing wrong here?