开发者

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;">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜