Is there a way to create a DIV class that will auto enable scroll bars within that div if the text inside requires more than 'X' amount of height?
Robin_reala
4:58 pm on Oct 5, 2006 (gmt 0)
Yep:
div { overflow: auto; height: 500px; }
Obviously change the selector to select your particular div, and the height to what you want.
inveni0
6:42 pm on Oct 5, 2006 (gmt 0)
Awesome, thanks!
Robin_reala
9:13 pm on Oct 5, 2006 (gmt 0)
As an addendum: that'll also create a horizontal scrollbar. The current working draft of CSS3 box model module specifies overflow-x and overflow-y [w3.org] which let you dictate overflow for specific axes. This was first introduced by IE, pulled into the current spec, then added into Gecko in time for Firefox 1.5. As it's still in working draft you shouldn't expect stability, but w3 don't usually change specs if there's a couple of interoperable implementations.