Try something similar, only with CSS
CSS
#home{ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #F7F7F7), color-stop(1, #BABABA)); width:100px; height:45px; text-align:center; border-radius:10px; position:relative; top:15px; left:15px; } #home:hover{ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #F7F7F7), color-stop(1, #FFFFFF)); } #homenav{ font-family:Arial, Helvetica, sans-serif; text-decoration: none; color:#000000; position:relative; top:12.5px; }
DEMO http://jsfiddle.net/enve/ZauwA/11/
To change text on hover, use this code
HTML
<nav> <div id="home"> <a href="home.html" id="homenav" onmouseover="changeText()" onmouseout="returnText()">HOME</a> </div> </nav>β <script> function changeText() { document.getElementById("homenav").innerHTML='Welcome' } function returnText() { document.getElementById("homenav").innerHTML='Home' } </script>
FULL DEMO http://jsfiddle.net/enve/ZauwA/19/
source share