Responsive fullscreen div (followed by vertical scrolling)

I am trying to create a fullscreen div, so it resizes and height and the width of the browser window.

But then you can scroll vertically in the second div, which is also the size of your browser window.

I saw many examples of this style, but I can not find any textbooks. Perhaps I have the wrong keywords?

A good example is http://www.guestd.com (except that I don't need background images and you only want two divs).

Thanks.

+4
source share
1 answer

With pure CSS, you can do this very simply.

HTML

<div class='tile' id='a'> </div> <div class='tile' id='b'> </div> 

CSS

 body,html { width: 100%; height: 100%; } .tile { height: 100%; width: 100%; position: relative; background-color: #eaeaea; } #a { background-color: #222; } 

will provide you

+11
source

All Articles