0

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 2

1

you have to have overflow-x:hidden and word-wrap:break-word

http://jsfiddle.net/VgB2F/2/

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks thanks thanks....Also, is there any way i can add some padding in there to make it look a little non-crowded?
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
1

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;
}

http://jsfiddle.net/enve/VgB2F/5/

2 Comments

He wants it to scroll in Y, not X. It is currently scrolling in X.
"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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.