HTML DIV inner scroll
I need a DIV to have 开发者_如何学编程constant width, regardless showing the scroll bar.
This is what I have so far:
<div style="overflow: auto; width:100%; height: 100px;">
How should this be changed ?
The overflow
style has a scroll
property which does what you want. You may also want to split it out into overflow-x
and overflow-y
to allow you to control the two scrollbars independantly:
div {
width:100%;
height:100%
overflow-x:scroll;
overflow-y:scroll;
}
Change the x or y overflow to none
or auto
depending on what combination of scroll bars you need.
To get a constant width, specify a pixel value:
<div style="overflow: auto; width:200px; height: 100px;">
精彩评论