SFB Posted May 27, 2006 Share Posted May 27, 2006 I was wondering if there was a way to get a scroll bar on something like a div. I want to use css. I dont want to use a textarea or a frame. Link to comment Share on other sites More sharing options...
snowboard01 Posted May 27, 2006 Share Posted May 27, 2006 sure you can! <html><head><title>somthing or other</title><style type="text/css">.scrolldiv{overflow:scroll;}</style></head><body><div class="scrolldiv">this div scrolls.<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />Thank you for scrolling so far!</body></html> Link to comment Share on other sites More sharing options...
SFB Posted May 27, 2006 Author Share Posted May 27, 2006 wow duh. i should have guessed it was siple like that. thanks! Link to comment Share on other sites More sharing options...
SFB Posted May 27, 2006 Author Share Posted May 27, 2006 ok well that didnt work so well. I need the scroll bar only on the left and only when it is needed. it shows up when it isnt needed like on the bottom. Link to comment Share on other sites More sharing options...
SFB Posted May 27, 2006 Author Share Posted May 27, 2006 YES! I GOT IT!all i had to do was replace overflow: scroll;with overflow-x: hidden;overflow-y: scroll;now i dont have the bottom scroll bar any more. Link to comment Share on other sites More sharing options...
reportingsjr Posted May 27, 2006 Share Posted May 27, 2006 there are easier ways lol.. heres what I did for mine: width: 500px; height: 200px; overflow: auto; overflow: auto; mine never has a bottom scroll bar, but you have to set the width and height Link to comment Share on other sites More sharing options...
SFB Posted May 27, 2006 Author Share Posted May 27, 2006 there are easier ways lol..In my opinion this way was prety easy Link to comment Share on other sites More sharing options...
reportingsjr Posted May 27, 2006 Share Posted May 27, 2006 I do beleive that when you put overflow-x: hidden; that you wont be able to see the content that is past the side, like the part that used the scroll bar.. Link to comment Share on other sites More sharing options...
SFB Posted May 27, 2006 Author Share Posted May 27, 2006 well i do belive that I wrap the text so it doesnt.EDIT: I love to be an impossible person lol Link to comment Share on other sites More sharing options...
Jonas Posted May 28, 2006 Share Posted May 28, 2006 overflow: auto;really is the best way, as it gives you a vertical scrollbar if you need it and a horizontal one if you need that. overflow-x: hidden; is not a bad idea of course, if you always remember to manually wrap the text, but why bother? Link to comment Share on other sites More sharing options...
SFB Posted May 28, 2006 Author Share Posted May 28, 2006 the horizontal scroll bar clutters my site so it really isnt that bad of idea to make sure it doesnt appear. I always manually wrap my text. I try to make my site look the same on all browsers. this topic should be closed. I will do things my way. Link to comment Share on other sites More sharing options...
reportingsjr Posted May 29, 2006 Share Posted May 29, 2006 Why would you wrap your text every time? thats extra code and wasted time.. just use overflow: auto; Link to comment Share on other sites More sharing options...
snowboard01 Posted May 29, 2006 Share Posted May 29, 2006 Ok even I aggree and the overflow scroll was my post Link to comment Share on other sites More sharing options...
SFB Posted May 29, 2006 Author Share Posted May 29, 2006 ok um i dont get what the problem is. my text wraps on its own. I dont have a scroll bar. It isnt set to have or not have a scroll bar any more. Link to comment Share on other sites More sharing options...
snowboard01 Posted May 29, 2006 Share Posted May 29, 2006 Oh I thought you were using <br />s Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now