基于精灵的菜单似乎不适用于某个位置:固定div

时间:2011-07-18 19:09:19

标签: css sprite

我在这个网站上找到了许多有用的东西,用于制作固定位置菜单和做基于精灵的翻转菜单。现在,我正在尝试将两者结合起来,但它似乎不起作用。在固定位置div内,用于菜单项的背景图像不会移动或允许我通过代码或悬停来改变位置。非常感谢任何建议。

1 个答案:

答案 0 :(得分:0)

The Css:
.Interact a {width: 143px; height: 24px; display: block; border: solid 0px #000;background: url(#IMG#);background-repeat:no-repeat;position:relative;background-attachment:scroll;}
.Q a:link, .Q a:visited{background-position:0 0;}
.Q a:hover {background-position: 0 -24;}

.floating-menu {position:fixed;top:-10;background:#FFF;border:1px solid #000;width:100px;z-index:11;}
.floating-menu a, div.floating-menu h3 {display:block;margin:0;}


The HTML:
<div class="floating-menu">
<h4>Menu</H4>
<div class="Interact Q"><a href="#"><img s rc="#BLANKIMG#" width=143 height=24></a></div>
</div>
相关问题