css3 - Div height 100% formatting Issue -
i trying make sidebar fill height between header , foot. can see going behind footer. stop @ top of footer. great!
demo at: http://www.jsfiddle.net/pebhk/
the html:
<div class="header"> <h2>development area</h2> </div> <div class="sidebar"> <h2>current projects</h2> <ul> <li>icalendar</li> <li>myband - student center</li> </ul> <h2>future projects</h2> <ul> <li>mobile application</li> <li>rss feed</li> </ul> </div> <div class="clear"></div> <div class="footer">© 2013</div> the css:
html, body, h1, h2 { margin:0px; padding:0px; } .clear { clear:both; } .header { display:inline-block; width:100%; background:#abbff2; height:100px; border-bottom: 5px solid #7f9deb; text-align:center; } .header h2 { padding-top:38px; } .sidebar { position: fixed; height:100%; width:250px; background:#abbff2; border-right:5px solid #7f9deb; float:left; } .sidebar h2 { text-align:center; } .footer { position:fixed; display:inline-block; bottom:0px; width:100%; height:30px; border-top:5px solid #7f9deb; text-align:center; }
try height:calc(100% - 140px) in .sidebar
.sidebar { position: fixed; height:calc(100% - 140px); width:250px; background:#abbff2; border-right:5px solid #7f9deb; float:left; }
Comments
Post a Comment