I have made a cool looking scrollbar. I can not seem to get this right. I only want the thing to scroll in the y axis. For some reason, it keeps on the x and y. I want to be able to type in as much as i want, and it space down when there is not enough room on the x axis.... http://jsfiddle.net/Hunter4854/VgB2F/ What am i doing wrong, and how do i fix it?
2 Answers
you have to have overflow-x:hidden and word-wrap:break-word
2 Comments
Hunter Mitchell
Thanks thanks thanks....Also, is there any way i can add some padding in there to make it look a little non-crowded?
Thomas Jones
jsfiddle.net/VgB2F/6. Note that I've lessened the width and height by the appropriate amount due to the css box model. quirksmode.org/css/box.html
replace in css
.scrollx{
width: 400px;
height: 300px;
background-color: #2A2A2A;
overflow-y:scroll;
}
with
.scrollx{
width: 400px;
height: 300px;
background-color: #2A2A2A;
overflow-y:scroll;
overflow-x:hidden;
word-wrap:break-word;
}
2 Comments
Thomas Jones
He wants it to scroll in Y, not X. It is currently scrolling in X.
Thomas Jones
"it space down when there is not enough room on the x axis" yours just overflows and hides the content.
word-wrap:break-word; solves this.