tags:

views:

35

answers:

2

Hi


We use overflow property to specify whether scroll bars should be provided when content overflows element’s box.

Is there a similar property with which we could specify whether horizontal scroll bars should be provided when the width of an element is greater than the width of a viewport ( ie display area )?


thanx

+1  A: 

This would have to be done with JavaScript. You would most likely want to write a function that would re-size the element to have the same width as the viewport and set scroll:auto on that element to mimic the behavior you are looking for.

Andrew Hare
+3  A: 

You should look into the overflow-x css property.

Julian Aubourg
Overflow-x is usefull when content overflows elements width - that is not the case here
SourceC
And you can't set your element width to 100% or whatever percentage applies to your situation?
Julian Aubourg