tags:

views:

47

answers:

1

What is the status on overflow-x and overflow-y? Whenever I give overflow a value, and inspect that element, the browsers tend to split this into overflow-x and overflow-y. However, trying to explicitly state this gives nothing.

For example, on my math class page: http:math.davehampson.net the grades tab is very wide, and I want it to scroll within the <div> There is no height declared, so it stretches down, and I get a horizontal scroll bar.

By problem is that I also get an unneeded vertical scroll bar. If I change overflow:scroll to overflow-x:scroll, then nothing happens. The table is displayed in full width, and the entire page scrolls. Which, because the body is black, does not show up.

Is there a way for me to eliminate this inactive vertical scroll bar?

Thanks, Dave

+2  A: 

overflow:auto only adds a scroll bar when the content within it exceeds the allocated space.

So if you only need a horizontal scroll, make sure the height of the content is less than the height of the enclosing div, if that makes sense.

dtt101
Except I need the height to "flow" with the contents. I could probably use javascript to grab the `<div>` height, then increase it by a few pixels, but I'd rather have a pure css solution.
the Hampster