August 28, 201313 yr Hello, I'm wanting to get the .wrap to go over the Content Area and the sidebar. So I can get the footer under them both. <div id="wrapper"> <header class="site-header"> <div class="head"> <h1>HEADER!</h1> </div><!-- .head ---> </header><!-- #masthead --> <div id="wrap"> <div class="content-area"> Content Area </div><!-- .content-area --> <div id="sidebar"> Side Bar </div><!-- #sidebar --> </div><!-- #wrap --> <footer id="footer" class="clear"> <div class="site-info">Side Bar!</div> <!-- .site-info --> </footer><!-- #colophon --> </div><!-- #wrapper --> #wrapper { margin: 0 auto; width: 1000px; } .head { height: 117px; padding-top: 0; position: relative; } #logo { position: absolute; text-align: left; top: 0; } .menusearch { position: absolute; right: 350px; top: 32px; width: 240px; } .searchform { background: none repeat scroll 0 0 transparent; border: 1px solid #00C3E1; height: 32px; width: 238px; margin: 10px 0; } #social { background: none repeat scroll 0 0 transparent; float: right; padding: 0; position: absolute; right: 10px; top: 40px; } #advertise{ height: 56px; margin: 0 auto 65px; position: relative; z-index: 18; } #wrap{ width: 1000px; margin: 0 auto; } .content-area{ width: 690px; padding:10px; float:left; color:#FFF; background: none repeat scroll 0 0 #000000; } #sidebar{ background: #000000; color:#FFF; float: right; margin-left: 20px; padding: 30px 10px 10px 10px; width: 250px; } #footer{ margin-top: 50px; } #footer .site-info{ background: none repeat scroll 0 0 #00C; color: #FFFFFFF; padding: 20px 0; text-align: center; } .clear{ clear:both;
August 28, 201313 yr Use the .clearfix hack next for future references. .clearfix:before, .clearfix:after { content:""; display:table; } .clearfix:after { clear:both; } /* For IE 6/7 (trigger hasLayout) */ .clearfix { zoom:1; } You simply wrap all your floated content in a container and give this container the class .clearfix, simple! http://jsfiddle.net/Samus/Gt95k/
Create an account or sign in to comment