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>
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
Post a Comment