I have a div that, depending on circumstances, can overflow. Is there a way so that, no matter how much data is in the div, it will not have a scroll bar? I was hoping that there would be a style I could just add like:

<div style="width:100; height:100; noscroll:true" >

Is there such a thing?

有帮助吗?

解决方案

Yes, you can use overflow: hidden; and it will never show a scroll bar. Note that this might also disable scrolling (even with mouse wheel) in some browsers.

You can specify overflow-x: hidden; for horizontal or overflow-y: hidden; for vertical scrollbars.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top