35

Is it possible to achieve only horizontal overflow in CSS 2.1?

overflow: auto;

Will cause a block element to have both horizontal and vertical scrollbars. I want a block element (let's say <div>) which will display only horizontal scrollbars. How do I do that?

3 Answers 3

51

Try overflow-x: auto;

It even works in IE6!

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

2 Comments

For FF you can use overflow: -moz-scrollbars-horizontal; -- I'm not sure about Webkit.
Although Mozilla claims that it will work in FF as low as version 1.5. developer.mozilla.org/en/CSS/overflow-x
8
overflow-x: clip;

Was what I needed

Comments

6

I tried overflow-x: hidden; and that worked for me.

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.