Nivo 背景位置被忽略
希望有人可以帮助我解决我在新设计上实现的 nivo 滑块上背景定位的 css 问题。
.nivo-nextNav
的背景位置被忽略,我不明白为什么。
这是我的CSS:
/* Direction nav styles (e.g. Next & Prev) */
.nivo-directionNav a {
display:block;
width:43px;
height:45px;
background:url(../images/arrows.png) no-repeat;
text-indent:-9999px;
border:0;
}
.nivo-prevNav {
left:0px;
}
.nivo-nextNav {
background-position: -43px 0;
right: 22px;
}
链接到页面: http://www.plumeriawebdesign.com/Headstand%20Software/
我现在可以使用它了。我将 .nivo-directionNav a
的 css 更改为以下内容:
.nivo-directionNav a {
position:absolute;
top:40%;
z-index:9;
cursor:pointer;
width: 43px;
height: 45px;
text-indent:-9999px;
background-image:url(../images/arrows.png);
background-repeat: no-repeat;
}
现在背景已正确定位。很好奇为什么它可以在他们网站上的默认滑块上工作,而不是在我的网站上。对我来说很奇怪。
Would like it someone could help me troubleshoot my css for the background positioning on a nivo slider I'm implementing on a new design.
The background-position is being ignored for .nivo-nextNav
and I can't figure out why.
Here is my css:
/* Direction nav styles (e.g. Next & Prev) */
.nivo-directionNav a {
display:block;
width:43px;
height:45px;
background:url(../images/arrows.png) no-repeat;
text-indent:-9999px;
border:0;
}
.nivo-prevNav {
left:0px;
}
.nivo-nextNav {
background-position: -43px 0;
right: 22px;
}
Link to the page: http://www.plumeriawebdesign.com/Headstand%20Software/
I have it working now. I changed the css for .nivo-directionNav a
to the following:
.nivo-directionNav a {
position:absolute;
top:40%;
z-index:9;
cursor:pointer;
width: 43px;
height: 45px;
text-indent:-9999px;
background-image:url(../images/arrows.png);
background-repeat: no-repeat;
}
Now the background is positioned properly. Curious though why it works on their default slider on their site and not mine. Strange to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的背景位置设置为 .nivo-nextNav,但 .nivo-nextNav 没有背景,链接有; .nivo-nextNav a 中的 'a' <-
最简单的解决方案:将位置放在后台;
Your background position is set to the .nivo-nextNav, but .nivo-nextNav doesn't have a background, the link does; the 'a' in .nivo-nextNav a <-
easiest solution: Put the position in the background;
背景位置仅定位背景图像。但是 .nivo-nextNav 元素中没有背景图像。
据我所知,NivoSlider 使用这样的箭头:
尝试在元素的开头使用锚标记。
background-position only positions the background-image. But there is no background-image in your .nivo-nextNav element.
From what I see NivoSlider uses the arrows like this:
Try using the anchor tag in the beggining of your elements.