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:
- the nav in fixed position , follows everywhere. got part down.
- 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:
got weird gap on right side though set right: 0
.
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 */ }
Comments
Post a Comment