css - Responsive 2 Column Absolute Positioning -
i have 1 page layout 2 sections (main-containers.) each main-container has 100% height , width. image class "pic" in section 2 absolute positioning sit on bottom of section two. of right sits on bottom of section one. think don't have cleared right. using (mobile first initializr) template. http://www.initializr.com
may not here fiddle
demo http://jsfiddle.net/jfarr07/7dwey/
html
<div class="main-container3" id="sponsorship"> <div class="main wrapper clearfix"> <article> <header class="branding"> oh possibilities </header> </article> </div> <!-- #main --> </div> <!-- #main-container3 --> <div class="main-container4" id="promotion"> <div class="wrap"> <div class="jared"> <img class="pic" src="images/jared.png" /></div> <div class="jaredinfo"></div> </div> </div> <!-- #main-container4 -->
css
body { height:100%; overflow:scroll; } html { height:100%; } article, aside, header { display:block; } } .main-container3 { background-image:url(../images/gopherbackground.png); background-position:center center; background-repeat:no-repeat; background-size:cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; min-height:100%; } .main-container4 { background-image:url(../images/graybackground.png); background-position:center center; background-repeat:no-repeat; background-size:cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; min-height:100%; } .wrap { width:90%; margin:0 auto; height:100%; min-height:100%; } .jared { background-color:#0c6; float:left; position:relative; height:100%; min-height:100%; width:40%; } .jaredinfo { background-color:#c60; float:right; position:relative; height:100%; min-height:100%; width:60%; } .pic { position:absolute; bottom:0; } .branding { font-size:44px; color:#fff; font-family: source-sans-pro, sans-serif;font-weight:700; text-align:center; } .wrapper { width: 90%; margin: 0 5%; max-width:1000px; } .main { padding: 30px 0; }
i guess problem might die 2nd container has height
of zero. 1 solution set fixed height
:
.main-container4 { height: 100px; }
if want have 100% height, need set
html { height: 100%; }
too (along height: 100%
on container). demo.
Comments
Post a Comment