Forum Moderators: not2easy
<p class="buttonhome"><a href="index.php">Home</a> .buttonhome {
position: relative;
display:block;
top: -71px;
right: -200px;
width:250px;
height:50px;
text-indent:-9999px;
}
.buttonhome a {
display:block;
width:100%;
height:100%;
background:url('../images/home_nav_button.png') no-repeat top left;
outline:none;
}
.buttonhome a:hover {
background-position:0 -50px;
} <ul>The css depends on the browser versions you are supporting. If more recent browsers than ie6, you can avoid classing the <li's> and use attribute selectors instead. Something like:
<li><a href="index.php">Home</a> </li>
<li><a href="two.php">Menu two </a> </li>
<li><a href="three.php">Menu three</a> </li>
</ul>
ul {
/*get rid of the markers*/
list-style-type:none;
}
li {
width:250px;
height:50px;
text-indent:-9999px;
/*make the li float on one line*/
float:left;
}
a {
display:block;
width:100%;
height:100%;
/* Set the background for the first menu item */
background-image: url(../images/home_nav_button.png);
background-repeat: no-repeat;
background-position: top left;
outline:none;
}
/* Use attribute selectors to set the different image and background-position on the other menu items*/
a[href="two.php"] {
background-image:url(...);
background-position: ...;
}
a[href="three.php"] {
background-image:url(...);
background-position: ...;
}
/* Change the image position on :hover */
a:hover {background-position:0 -50px; }
a[href="two.php"]:hover {background-position: ... ; }
a[href="three.php"]:hover { background-position: ... ; }