views:

925

answers:

1

Is it somehow 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 ) which will display only horizontal scrollbars. How to do that?

+5  A: 

Try overflow-x: auto;

It even works in IE6!

Cory Larson
Won't work in Webkit (Safari/Chrome) or Firefox
Josh Stodola
For FF you can use `overflow: -moz-scrollbars-horizontal;` -- I'm not sure about Webkit.
Cory Larson
Although Mozilla claims that it will work in FF as low as version 1.5. https://developer.mozilla.org/en/CSS/overflow-x
Cory Larson