2

I have the overflow-y:scroll option for a div with text. However, the scroll "space" (for lack of a better word for it) appears whether the text requires scrolling or not. How do I make the appearance of the scroll "space" conditional on whether the text has a long enough height?

2 Answers 2

3

Change scroll to auto

This value is browser and media dependent, but should allow for a vertical scrollbar if possible in case of overflow.

http://www.css3.com/css-overflow-y/

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

Comments

2

scroll means to always show the scrollbar; auto means to show it when necessary. Change it to auto instead.

Comments

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.