beennn Posted March 17, 2013 Share Posted March 17, 2013 I've been looking around but I can't figure out how to have scroll bars on a div only which has a height of 100%. With a set height, this works fine: overflow-y:scroll; However with 100%, the scrollbar appears on the div, however doesn't extend; instead the window has scroll bars. From what I've seen, I have tried: http://stackoverflow.com/questions/6499624/div-height-100-with-scroll-barhttp://stackoverflow.com/questions/14355957/div-with-100-height-having-no-browser-scrollbarshttp://www.sitepoint.com/forums/showthread.php?390159-Need-an-overflow-scrollbar-on-a-div-with-100-height but none of these have any affect. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 17, 2013 Share Posted March 17, 2013 body, html{margin:0; padding:0; height:100%; overflow:hidden;} #content{background-color:#FF6633; height:100%;overflow-y:auto; width:960px; margin: 0 auto; } it becomes a little complicated if you have headers and footers, as you have to allow for these, as these will force the #content outside the 100% height of browser window. Link to comment Share on other sites More sharing options...
beennn Posted March 18, 2013 Author Share Posted March 18, 2013 Thanks very much. 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