Creating an HTML Page with Inline Scrollbars
October 15, 2004 1:31 PM   Subscribe

Is there anyway to create an HTML page with inline scrollbars other than an iframe? ie, can I add scrollbars to a div somehow?
posted by sauril to Computers & Internet (8 answers total)
 
Yes, set the div's overflow property to scroll using CSS.
posted by riffola at 1:38 PM on October 15, 2004


The only downside is that you get both sets of bars. If you want to flashback to 1999, you can add browser-specific CSS to override this behavior:

overflow: -moz-scrollbars-vertical;
overflow-y: scroll;

"-horizontal" and "overflow-x" will get you the reverse if you want it.
posted by yerfatma at 1:45 PM on October 15, 2004


And set a height on that sucker, otherwise, no scroll for you.
posted by signal at 1:46 PM on October 15, 2004


awesome, awesome! I've always wondered how to do this myself. thanks guys! oh.. btw, any browser incompatibilties/quirks with this method one should be aware of?
posted by fishfucker at 3:10 PM on October 15, 2004


thank you thank you thank you thank you thank you!
posted by sauril at 3:28 PM on October 15, 2004


overflow:auto should kill the horizontal scroll bars in a "not 1999" way.
posted by alan at 4:30 PM on October 15, 2004


My 1999 comment just meant using Netscape and IE-specific implementations to achieve an effect. signal's point is well taken; without setting a height in addition to the overflow: scroll, there's no overflow.
posted by yerfatma at 5:08 PM on October 15, 2004


I've played around with this quite a bit after finding the technique at beforethedog. My favorite layout is here.
posted by taz at 11:41 PM on October 15, 2004


« Older Point and shoot film camera suggestions   |   Upgrading Epiphone Guitar Newer »
This thread is closed to new comments.