html - Webpage that doesn't overflow and has a 100% Height/Width -
as stated in title i'm trying make website can not scroll down or something, should cover whole webpage.
i tried doing whenever set height , width 100% doesn't seem work, make content inside wrapper exceeds 100% overflow.
edit: making equal 100% height/width doesn't work since i'm using borders , px.
i use flexbox sticky footer technique. 100vh makes height of screen , flexbox magic takes care of rest making fit no matter screensize. check out:
html
<body> <header></header> <main class="content"> <section class="left-side"></section> <section class="right-side"></section> </main> <footer></footer> </body>
css
body { display: flex; min-height: 100vh; padding: 0; margin: 0; flex-direction: column; background-color: red; } header { height: 50px; background-color: green; } main.content { display: flex; justify-content: space-between; flex: 1 0 auto; background-color: yellow; } .left-side, .right-side { display: block; height: auto; width: 20%; background-color: orange; } footer { height: 50px; background-color: blue; }
full codepen example: http://codepen.io/stefanbobrowski/pen/zzxxwy
Comments
Post a Comment