Mr. Boy
Mr. Boy

Reputation: 63738

Can you make a HTML element overflow-scroll ONLY vertically?

Is it possible to set a to add a scroll-bar vertically but clip horizontally?

EDIT I see some mention on CSS3 in answers. Which browsers support this?

Upvotes: 3

Views: 598

Answers (4)

carny666
carny666

Reputation: 2430

For horizontal scrolling:

overflow-x: auto;

For vertical scrolling:

overflow-y: auto;

Upvotes: 0

Quentin
Quentin

Reputation: 943591

overflow: auto;     /* For CSS 2 user agents */
overflow-x: hidden; /* For UAs implementing the CSS 3 property */

Upvotes: 3

meder omuraliev
meder omuraliev

Reputation: 186562

html { overflow-x:hidden; overflow-y:auto; }

or { overflow-y:scroll; }

Haven't tested but try it.

Upvotes: 7

VoteyDisciple
VoteyDisciple

Reputation: 37803

Yes.

overflow-y: auto;
overflow-x: hidden;

Upvotes: 2

Related Questions