css - How do I make a div 100% of the viewport without using fixed positioning? -


how able make side bar 100% of entire page rather 100% of screen if div larger screen?

i'd avoid using fixed positioning on side bar need contain large amounts of information require scrolling.

body {     height:100%;     background:red; } #container {     width:50%;     margin:0 auto;     height:1200px;     background:white; } #left {     position:absolute;     float:left;     height:100%;     width:100px;     background:black; }  <body>     <div id="left"></div>     <div id="container"></div> </body> 

http://jsfiddle.net/jbmbr/2/

does achieve desire? http://jsfiddle.net/david_knowles/qftd5/

body{ height:100%; background:red; position:relative;} #container{ width:50%; margin:0 auto; height:1200px; background:white;} #left{ position:absolute; top:0; bottom:0; right:0; width:100px; background:black; overflow:scroll;} 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -