简体   繁体   English

溢出:隐藏,我在这里做错了什么

[英]overflow:hidden, what am i doing wrong here

I have explicitly positioned divs, inside a parent div tag. 我在父div标签内明确定位了div。 The thing is, when I resize my browser window, i am able to scroll to the specified div position which I don't want to. 问题是,当我调整浏览器窗口大小时,我可以滚动到指定的div位置,这是我不想要的。 I tried using overflow and it kinda does nothing other than hiding the div completely. 我尝试使用溢出,它除了完全隐藏div之外什么也没做。 I am clearly missing something here. 我在这里显然遗漏了一些东西。 How do I hide the image when I resize my browser window ? 调整浏览器窗口大小时如何隐藏图像? How can I solve this ? 我怎么解决这个问题?

 .Topics__imageContainer { position: absolute; -webkit-transition: opacity .5s,-webkit-transform .5s; transition: opacity .5s,-webkit-transform .5s; transition: transform .5s,opacity .5s; transition: transform .5s,opacity .5s,-webkit-transform .5s; } .Topics__image { border-radius: 50%; border: 3px solid #fff; background-color: #fff; box-sizing: content-box; overflow-x:hidden; display:inline-block; } .icon_wrapper_inner{ overflow-x: hidden; position: relative; } 
 <div class="icon_wrapper_inner"> <div class="Topics__imageContainer" style="opacity: 1; left: 1380px; top:268px;"> <div class="Topics__image Topics__image--far" style="width:50px;height:50px;background:url('http://4hdwallpapers.com/wp-content/uploads/2013/05/Emo-Star-Dekstop-Background-728x546.jpg');background-size:100%"> </div> </div> </div> 

Try reversing the hidden logic in the CSS. 尝试颠倒CSS中隐藏的逻辑。

overflow: hidden;
overflow-y: auto;

I fixed it by adding overflow:hidden inside html in bootstrap.css. 我通过在bootstrap.css中添加overflow:hidden in html来修复它。 Now the overflow is hidden as i resize my browser preventing it from scrolling. 现在溢出被隐藏,因为我调整浏览器大小以防止它滚动。

 html { font-size: 62.5%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-x:hidden; } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM