0

I'm looking for a solution for combining different x and y overflow.

Following code:

 div {
 overflow-x: visible;
 overflow-y: hidden;
 }

doesn't work. I want a simple method to hide horizontal scrollbar, keeping the vertical overflown content visible. I do not want to change the DIV's height in layout. Any tricks?

2 Answers 2

1

I want a simple method to hide horizontal scrollbar, keeping the vertical overflown content visible.

for horizontal -> overflow-x
for vertical   -> overflow-y

You could just use

div{
overflow-x: hidden;
overflow-y: auto; // if you don't want scrollbar use visible
}
Sign up to request clarification or add additional context in comments.

Comments

0

Use the below.

div {
 overflow-x: hidden;
 overflow-y: scroll;     
 }

WORKING DEMO

The HTML Code:

<div>This is a div.</div>

The CSS Code:

div {
 overflow-x: hidden; 
 overflow-y: scroll;
 display:inline-block;
 }

Hope this helps.

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.