开发者

Horizontal nav with CSS rollover

开发者 https://www.devze.com 2023-02-20 17:02 出处:网络
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?

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

Horizontal nav with CSS rollover


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消