html - Viewport height 100% not working on page element -
i have no idea why border stops before bottom of page. i have tried lots of things: clearing floats, 100%, jquery, vh, vmax + have read other questions stackoverflow stops before bottom.
i have 2 divs section.left
, section.middle
. trying 8 px
border on section.left
div go top of page bottom. stops if page gets longer.
see demo
html
<div class="wrapper"> <section class="left"> <header> <a class="logo" href="#"><img src="images/smallimage1.jpg" alt="logo"></a> </header> <div class="intro"> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit. sed posuere interdum sem. quisque ligula eros ullamcorper quis,</p> <a class="contact" href="#">contact</a> </div> <div class="skills"> <h6>skills</h6> <ul> <li>skill 1</li> <li>skill 2</li> </ul> </div> <footer> <p>2016 - site 1</p> </footer> </section> <section class="midle"> <div class="post"> <h2>headline</h2> <img src="images/bigimage1.jpg" alt="big image"> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit. sed posuere interdum sem. quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. mauris varius diam vitae arcu. sed arcu lectus auctor vitae,</p> <img src="images/bigimage2.jpg" alt="big image"> <img src="images/smallimage1.jpg" alt="small image"> <img src="images/bigimage1.jpg" alt="big image"> <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit. sed posuere interdum sem. quisque ligula eros ullamcorper quis, lacinia quis facilisis sed sapien. mauris varius diam vitae arcu. sed arcu lectus auctor vitae,</p> <img src="images/bigimage2.jpg" alt="big image"> </div> </section> </div> <!-- end of wrapper -->
css
html, body{ height: auto; width: 100%; display: block; background-color: #f8f8f8; margin: 0; padding: 0; } * { box-sizing: border-box; } img{ display: block; width: auto; max-width: 100%; height: auto; } .wrapper{ margin: 0 auto; width: 100%; height: auto; max-width: 1700px; padding: 0; overflow: hidden; } /*---------------- end of base ------------------------*/ section{ float: left; margin: 0; padding: 0; position: relative; } /*---------------- section left ------------------------*/ section.left{ width: 20%; padding: 4% 2%; height: 100vmax; text-align: center; border-right: 8px solid #60689d; } /*---------------- section midle ------------------------*/ section.midle{ width: 80%; height: auto; display: block; overflow: hidden; }
how setting .left
border transparent
, adding pseudo element serve border instead.
.wrapper:after { box-sizing: border-box; content: " "; display: block; width: 20%; padding: 4% 2%; height: 100%; text-align: center; border-right: 8px solid #60689d; position: absolute; left: 0; z-index:1; }
see demo
this way regardless 1 between .left
, .right
longer, border reach bottom of .wrapper
Comments
Post a Comment