i need to use an horizontal scollbar only if the content of the div is longer than the width value.
so i write :
.viewgallerylist{width:920px; float:left; padding-top:20px; height:120px; border-bottom:1px #000000 solid; overflow-x: scroll;}
the problem is that the scrollbar are 2, 1 horizontal and 1 vertical. How to remove the vertical one? cheers
To enable horizontal scrolling, we can use the CSS property overflow-x. If we assign the value scroll to the overflow-x property of the container element, the browser will hide horizontally overflowing content and make it accessible via horizontal scrolling.
Use overflow: auto . Scrollbars will only appear when needed. (Sidenote, you can also specify for only the x, or y scrollbar: overflow-x: auto and overflow-y: auto ).
To hide the vertical scrollbar and prevent vertical scrolling, use overflow-y: hidden like so: HTML. CSS.
.viewgallerylist {
min-width: 920px;
overflow: hidden;
-ms-overflow-x: auto; /* IE8 */
overflow-x: auto;
}
(min-width doesn't work in IE6, in case you still want to support that dinosaur)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With