Hi there, I’m a beginner and followed a tutorial on creating a sprite menu. I’m having some issues with it though. It’s cut off, pushed down, and to the right when I look at my site. I want it to fit within my ‘main-nav’ div.
Any help would be so greatly appreciated!
}
#main-nav {
background-color: #FFFFFF;
height: 50px;
padding-bottom: 13px;
padding-top: 1px;
clear: both;
}
ul#main-nav {
width: 800px;
list-style: none;
}
ul#main-nav li { display: inline; }
ul#main-nav li a {
display: block; float: left; height: 50px;
background-image: url(nav.png); text-indent: -9999px;
}
ul#main-nav li a.home {
width: 84px; background-position: 0 0;
}
ul#main-nav li a.about {
width: 98px; background-position: -84px 0;
}
ul#main-nav li a.entertainers {
width: 98px; background-position: -182px 0;
}
ul#main-nav li a.live {
width: 99px; background-position: -280px 0;
}
ul#main-nav li a.performance {
width: 97px; background-position: -379px 0;
}
ul#main-nav li a.upgrades {
width: 97px; background-position: -476px 0;
}
ul#main-nav li a.contact {
width: 98px; background-position: -573px 0;
}
ul#main-nav li a.design {
width: 96px; background-position: -671px 0;
}
ul#main-nav li a.home:hover, ul#main-nav li a.home:focus {
background-position: 0 -50px;
}
ul#main-nav li a.about:hover, ul#main-nav li a.about:focus {
background-position: -84px -50px;
}
ul#main-nav li a.entertainers:hover, ul#main-nav li a.entertainers:focus {
background-position: -182px -50px;
}
ul#main-nav li a.live:hover, ul#main-nav li a.live:focus {
background-position: -280px -50px;
}
ul#main-nav li a.performance:hover, ul#main-nav li a.performance:focus {
background-position: -379px -50px;
}
ul#main-nav li a.upgrades:hover, ul#main-nav li a.upgrades:focus {
background-position: -476px -50px;
}
ul#main-nav li a.contact:hover, ul#main-nav li a.contact:focus {
background-position: -573px -50px;
}
ul#main-nav li a.design:hover, ul#main-nav li a.design:focus {
background-position: -671px -50px;
}
a { outline: none; }
If you changed the measurements of each tab and or the whole width/height of the image then you will need to recalclulate it. Can you post the new image you created?
And I’m assuming your using Pauls full code
Hi, the image size is the same, however the changes you say you have made to both images are so small I can’t really tell.
In the background-position property you can change the first value until it lines up, I don’t know which way you changed the image (whether text to the right or left) so I can’t really help :).