CSS - Only Horizontal Overflow?

Richard Knop picture Richard Knop · Aug 26, 2009 · Viewed 54.7k times · Source

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?

Answer

Cᴏʀʏ picture Cᴏʀʏ · Aug 26, 2009

Try overflow-x: auto;

It even works in IE6!