[CSS]Div with Scroll bar

Example #1-Create a div with both vertical and horizontal scroll bars:

<div style=”width:300px;height:100px;overflow:auto;”>some text</div>

Example #2-Create a div with either vertical or horizontal scroll bars but not both:

<div style=”width:300px;height:100px;overflow-x: hidden;overflow-y:scroll;overflow:-moz-scrollbars-vertical !important;”>some text</div>

Example #3-you want to have div with only horizontal scroll bars, you can write like this

<div style=”overflow-x:scroll ;overflow-y:hidden;overflow:-moz-scrollbars-horizontal !important;”>some text</div>

http://chrisbalboa.wordpress.com/2007/07/06/cssdiv-with-scroll-bar/

沒有留言:

發佈留言