子元素不继承父元素的弯曲边缘?
我的我的页面上有一个轮播。我的父元素和子元素的边缘都是弯曲的,但是当您按“下一个”或“上一个”并滑动轮播时,子元素在移动时不会保持弯曲。我怎样才能防止这种情况发生?
.holder {
width:650px;
margin:200px auto;
overflow:hidden;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
#s7 #posts {
width: 620px;
padding: 15px;
color: #333;
font-size: 14px;
text-align:left;
background:#EEE;
line-height:16px;
min-height:500px;
overflow:visible;
z-index:-1;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
I have a carousel at my page. I have both the parent element and the child element's edges curved but when you press "Next" or "Previous" and slide the carousel the child doesn't stay curved when moving. How can I prevent this?
.holder {
width:650px;
margin:200px auto;
overflow:hidden;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
#s7 #posts {
width: 620px;
padding: 15px;
color: #333;
font-size: 14px;
text-align:left;
background:#EEE;
line-height:16px;
min-height:500px;
overflow:visible;
z-index:-1;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实上,我敢打赌它确实保持弯曲,只是看起来有点快。它看起来不是弯曲的,因为你在它动画时看到的是它的中间,当然,它不是弯曲的(例如,你看到的是盒子的顶部,而不是左上角角落)。
将半径添加到父级
div#s7
中,您应该已设置完毕。Actually, I'm willing to bet that it does stay curved, it's just a little to fast to see. It doesn't look curved because you're seeing the middle of it while it's animating which, of course, is not curved (e.g. you're seeing the TOP of the box, not the top-left corner).
add the radius to the parent
div#s7
and you should be set.确保将
border-radius
CSS 传递到 JavaScript 中,或者更确切地说,确保 JS/JQuery 不会删除它。使用 Firebug,我可以看到没有为生成的所有
分配 border-radius 属性。在 JS 中添加该属性应该可以解决问题。
Be sure you're passing the
border-radius
CSS into the JavaScript, or rather, make sure JS/JQuery isn't removing it.Using Firebug, I can see that there is no border-radius property assigned to all of the
<div>
s that are generated. Adding that attribute within your JS should remedy the problem.