我正在使用 animate.css向网站添加一些动画。
一些动画如“fadeInLeft/Right”或“bounceInLeft/Right”使水平滚动出现。这很容易修复,将 overflow-x:hidden 添加到父级。
但现在我有一个绝对定位的按钮,放置在两个父 div 的中间。父 div 有 overflow-x:hidden 但它似乎不影响按钮,因为position:absolute。
如何避免按钮动画时出现水平条?
这是网站http://themescreators.com/demos/cuora/这些按钮是介绍 slider 下方和页脚上方的圆形白色 float 按钮。
最佳答案
尝试溢出隐藏:
body {
overflow-x: hidden;
}
.hidden-thing {
position: absolute;
left: 100%;
width: 50px;
height: 50px;
opacity: 0;
}
检查此资源: https://css-tricks.com/findingfixing-unintended-body-overflow/
关于html - 如何避免由绝对定位的div引起的水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28880685/