1

我一直有一个CSS问题。我有一个 div,其中包括一个图像 div、一个包含链接的 div 和一个包含描述的 div,分别命名为侧边栏、sbpic、lks 和 desc。

对于图像,这是我目前拥有的代码:

#sbpic {
background-image:url('{image:Sidebar1}');
background-attachment:fixed;
background-repeat:repeat;
background-position:0px 50px;
position:fixed;
width:230px;
height:130px;
margin:10px 0px 0px -25px;
-webkit-transition: all 1s ease-out;
-moz-transition: all 1s ease-out;
transition: all 1s ease-out;  
}

#sidebar:hover #sbpic {
margin-top:305px;
-webkit-transition: all 1s ease-out;
-moz-transition: all 1s ease-out;
transition: all 1s ease-out;  
}

它在预览中运行良好,您可以在此处看到

但是当我打开我的网站时,这就是这里的结果

我尝试使用#sbpic:hover 并更改那里的背景位置,我还尝试更改#sidebar:hover #sbpic 上的背景位置。第一个只有在我将鼠标悬停在图片上时才有效,而后者会使图片在到达底部时偏离 50px。

有什么建议么?

4

0 回答 0