var images = ['ghc1', 'ghc2', 'ghc3', 'ghc4', 'ghc5', 'ghc6', 'ghc7',
'ghc8', 'ghc9', 'ghc10', 'ghc11', 'ghc12', 'ghc13', 'ghc14', 'ghc15',
'ghc16'
];
var container = document.querySelector('#images');
images.forEach(function(file) {
var img = document.createElement('img');
img.src = 'images/ghc/' + file + '.jpg';
container.appendChild(img);
});
.header {
text-align: center;
padding: 32px;
}
.footer {
text-align: center;
padding: 32px;
}
body {
background-color: #87CEEB;
}
#images>img {
margin: 10px;
border: 3px solid #000;
box-shadow: 3px 3px 8px 0px rgba(0, 0, 0, 0.3);
max-width: 25vw;
-ms-flex: 25%;
/* IE10 */
flex: 25%;
max-width: 50%;
vertical-align: middle;
}
#images {
margin: 0 auto;
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Girls + Cats</title>
</head>
<body>
<div class="header">
<img alt="Girls + Cats" src="images/girlsholdingcats.png">
</div>
<div id="images" class=images>
</div>
<div class="footer">
<a href="index.html"><img alt="Home Page" src="images/homepage.png"></a>
</div>
</body>
</html>