5
votes

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

4

4 Answers

11
votes
.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)

4
votes

overflow-x:scroll creates a horizontal scrollbar if the content exceeds the width of the container. overflow-y:scroll creates a vertical scrollbar if the contents exceeds the height of the container.

3
votes

Try

.viewgallerylist {
  overflow-y: hidden;
}
2
votes

Use overflow-y: hidden.