twitter bootstrap - CSS how to fit 100% height and width? -


i creating landing page html/css , using little bit of bootstrap. having trouble resizing main page fit 100% height , width when page opened.

i want google docs' main page: https://www.google.com/docs/about/. if go there, you'll see:

  1. the nav in fixed position , follows everywhere. got part down.
  2. the main image automatically resizes depending on screen size. icon-arrow-hint (the arrow on mid-bottom of page) can seen on bottom of image.

two problems have:

gap on right

got weird gap on right side though set right: 0.

need scroll down

after page load, looks fits 90% of height , still need scroll down. placed text on bottom - theoretically, should shown on bottom of screen without scrolling, have scroll down.

this jsfiddle: https://jsfiddle.net/iggyfiddle/dtchh/35435/

i using position: absolute , 0-ed 4 sides.

how can fit yellow div 100% height , 100% width google page nicely?

if give element height: 100%, there's element above or below in same container, need adjust height of other element, otherwise there overflow.

also, adjust -15px horizontal margins applied bootstrap.

try this:

.primary-content {     position: absolute;     top: 10%;     left: 0;     right: 0;     bottom: 0;     width: 100%;     height: 90%;          /* adjustment */     background: yellow;     margin: 0;            /* new */ } 

https://jsfiddle.net/dtchh/35437/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -