First : positioning the divs
Set
html, body {
width:100%;
height:100%;
margin:0;
padding:0;
}
So you have a baseline that follows the width/height of the viewport.
Then, make a container that will contain all the "pages" with width:500%; height:500%;
Use child div
s to create each "page" and give them width:20%; height:20%;
(these divs will then be 100% width/height of viewport). And float them left so they align like a grid.
Second : the images
The best aproach here would be to set the images as background images of each child div
(="pages") and use the CSS property background-size:contain;
and background-position:center center;
so they adpat/crop and center horizontaly/verticaly according to viewport height/width.
Using this technique will save you from blanks between images and images loosing theire aspect ratio.
Alternative solution with <img>
tag
I don't recomend this solution exept if you don't mind having gaps on the right/left of images on screens that have a wider aspect ratio than your images.
Images are resized using width:auto; height:100%;
to adapt like in your example. They are horizontaly centered with display:block; margin:0 auto;
Code for the background technique :
HTML :
<div id="wrap">
<div class="image img1"></div>
<div class="image img2"></div>
<div class="image img3"></div>
<div class="image img4"></div>
<div class="image img5"></div>
<div class="image img4"></div>
<div class="image img5"></div>
<div class="image img1"></div>
<div class="image img2"></div>
<div class="image img3"></div>
<div class="image img1"></div>
<div class="image img2"></div>
<div class="image img3"></div>
<div class="image img4"></div>
<div class="image img5"></div>
<div class="image img4"></div>
<div class="image img5"></div>
<div class="image img1"></div>
<div class="image img2"></div>
<div class="image img3"></div>
<div class="image img1"></div>
<div class="image img2"></div>
<div class="image img3"></div>
<div class="image img4"></div>
<div class="image img5"></div>
</div>
CSS :
html, body {
width:100%;
height:100%;
margin:0;
padding:0;
}
#wrap {
width:500%;
height:500%;
}
.image {
width:20%;
height:20%;
float:left;
background-size:cover;
background-position:center center;
background-repeat:no-repeat;
}
.img1{
background-image: url(http://lorempixel.com/output/city-q-g-1724-977-9.jpg);
}
.img2{
background-image: url(http://lorempixel.com/output/nature-q-c-1724-977-1.jpg);
}
.img3{
background-image: url(http://lorempixel.com/output/fashion-q-g-1724-977-5.jpg);
}
.img4{
background-image: url(http://lorempixel.com/output/city-q-c-1724-977-8.jpg);
}
.img5{
background-image: url(http://lorempixel.com/output/sports-q-g-1724-977-9.jpg);
}