Horizontal nav with CSS rollover
The roll开发者_如何学JAVAover's uses one image for the hover. It's cool, but I don't know how to get it to work in a horizontal menu. What do I do?
<head>
<style>
/*CSS HOVER WITH ONE IMAGE*/
#emailUs{display: block;width: 107px;height: 23px;background: url("slide.jpg") no-repeat 0 0;}
#emailUs:hover{background-position: 0 -23px;}
#emailUs span{position: absolute;top: -999em;}
</style>
</head>
<body>
<!--Trying to get three buttons to go across 'same button as example'-->
<a id="emailUs" href="#" title="Email Us"><span>Email Us</span></a>
<a id="emailUs" href="#" title="Email Us"><span>Email Us</span></a>
<a id="emailUs" href="#" title="Email Us"><span>Email Us</span></a>
</body>
</html>
</html>
CSS SPRITE
I believe you're looking for the css: "float:left;"
Once you set a link to "display:block;", it will automatically go to the next line after - so - making them float left will bring them back up into a horizontal line.
Also, you shouldn't have more than one element with the same id. Use class instead for anything you'll need on more than one element.
精彩评论