css - Setting HTML height to 100% eliminates scrolling -


i cannot figure out why not working.

i need set height of html , body 100% setting height of 3 rows inside page, when eliminates scrolling, on mobile devises on browsers windows sizes when resizing.

    html, body {        height: 100%;        display:block;        margin: 0;        padding: 0;        background-color: #f7f7f7;        overflow:scroll;      }      .row1 {height:15%;} // header      .row2 {height:70%;} // body      .row3 {height:15%;} // footer
  <html>        <body>          <div class="row1"> ...needs 15% height </div>          <div class="row2"> ...needs 70% height </div>          <div class="row3"> ...needs 15% height </div>        </body>      </html>

if remove 100% on html page scrolls height, needs percentage based, not work. on how solve appreciated.

all posts found googling , looking @ code have on other projects have not provided solution issue.

html, body {        height: 100vh;        width: 100%;        margin: 0;        padding: 0;        background-color: #f7f7f7;        overflow:scroll;      }      .container{         height: 100%;        width: 100%;        display:inline-block;       }      .row1 {height:15%;width: 100%;display:inline-block;}       .row2 {height:70%;width: 100%;display:inline-block;}       .row3 {height:15%;width: 100%;display:inline-block;} 
 <html>        <body>          <div class="container">          <div class="row1"> ...needs 15% height </div>          <div class="row2"> ...needs 70% height </div>          <div class="row3"> ...needs 15% height </div>          <div>        </body>      </html>

added style element , div container & take of comment //


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -