3

I am creating a <div> with a class someClass

.someClass {
   overflow:scroll
   /*other props*/
}

The problem is that the scrollbars are always visible even when the data is not overflowing. I want the scrollbars to be visible only when data actually overflows.

2 Answers 2

10

overflow:auto; should do it. You need to set a width (for horizontal scrolling) and height (vertical) for that to pop out scrollbars at the right time though.

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

Comments

4

Use overflow: auto;

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.