最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is alternate for overflow:overlay css property in mozilla and internet explorer browsers - Stack Overflow

programmeradmin2浏览0评论

overflow:overlay is working fine in chrome and safari. This property isn't available in IE and Mozilla browsers. I need the scroll bar pane to be visible always.

overflow:overlay is working fine in chrome and safari. This property isn't available in IE and Mozilla browsers. I need the scroll bar pane to be visible always.

Share Improve this question edited Apr 24, 2019 at 6:39 codejockie 10.9k4 gold badges48 silver badges57 bronze badges asked Feb 27, 2018 at 23:14 koushik uikoushik ui 911 gold badge1 silver badge3 bronze badges 3
  • 2 my advice: don't use deprecated functionality ... according to MDN This deprecated API should no longer be used, but will probably still work - though, it only ever "worked" in webkit – Jaromanda X Commented Feb 27, 2018 at 23:26
  • Check out stackoverflow./questions/43050434/… – omukiguy Commented Feb 28, 2018 at 3:49
  • Official Mozilla Doc – law_81 Commented Feb 28, 2018 at 12:48
Add a ment  | 

1 Answer 1

Reset to default 1

As mentioned by in the ments above and in the doc: https://developer.mozilla/en-US/docs/Web/CSS/overflow

This deprecated API should no longer be used, but will probably still work.

However, since you mentioned:

I need the scroll bar pane to be visible always.

You can use the value overflow: scroll, and you will always have the scrollbar whether or not any content is actually clipped, and this will prevent the content from moving and changing your layout, for example:

div {
  border: 1px solid black;
  float: left;
  height: 100px;
  margin: 10px;
  overflow: scroll;
  width: 200px;
}
<div>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dictum ligula vel dolor eleifend, vel interdum risus tristique. Nullam laoreet sed metus at aliquam. Aliquam ornare sagittis nibh in volutpat. Sed dolor orci, viverra ut lectus ac, modo faucibus nisl. Proin molestie felis ligula, ullamcorper sollicitudin lacus modo eu. Curabitur sit amet cursus ante. Aliquam vel leo et justo luctus semper eget sit amet turpis. Aenean ac rhoncus dolor. Etiam ut euismod arcu, vehicula suscipit ex.   Donec nec posuere sapien. Phasellus accumsan sem nec nibh congue, ut porttitor diam convallis. Nulla ac tempus arcu. Suspendisse at lorem est. Nullam sit amet modo felis. Quisque ac mollis metus. Duis varius eleifend sem, eget venenatis ante mattis
  at.
</div>

<div>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dictum ligula vel dolor eleifend, vel interdum risus tristique. 
</div>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论