I want to expound on KeepItHamsta's solution...
#1) Do it ONLY if your image is NOT content! It really would be a mess if you had to use different images or update the page... ugh.
If it is content the best solution is:
Code:
ul.searchbtn a{ display:block}
ul.searchbtn li{ text-align:center;}
That's it ; you just had the text align on the wrong element, style the rest to suit your aesthetic sensibilities.
OK back to KeepItHamsta's:
It would be more efficient, as seen above, to give the UL the class instead of each individual link.
Code:
<ul class="searchbtn">
<li >
<a href="#" >link 1</a>
</li>
<li >
<a href="#" >link 2</a>
</li>
<li >
<a href="#" >link 3</a>
</li>
</ul>
and then this CSS
Code:
.searbutton a {display:block; text-align:center; padding-top: (height of image + let's say 10px); background:url(yourimage.jpg) no-repeat center 5px;}
This (or hapmsta )wont save any http request. It is a BAD idea to declare height AND with on text links, and for a spite technique to work you have to fave fixed dimensions. If you are dead set in using sprites.. you could use the :before pseudo element but remember you will have to have some fixes for ltIE7
Code:
ul.searchbtn a{ display:block; }
ul.searchbtn li{ text-align:center;}
ul.searchbtn li:before{ display:block;content:""; background:url(yourimage.jpg) no-repeat center top; height:(height of your image); }
Then create a VERTICAL sprite
hope this gives you some options to work with
Bookmarks