mh108
7/3/2018 - 7:35 PM

gallery app 111 18U

basic client-side javascript example, with responsive layout

body {
  margin: 40px;
}

.container {
  display: grid;
  grid-gap: 5px;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  grid-template-rows: auto auto;
  background-color: #fff;
  color: #444;
}

.box {
  background-color: #444;
  color: #fff;
  border-radius: 5px;
  padding: 20px;
  font-size: 150%;
}

.a {
  grid-column: 1 / span 3;
  text-align: center;
}

.b {
  grid-column: 1 / span 2;
  grid-row: 2;
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  grid-template-rows: repeat(2, 100px);
}

.c {
  grid-row: 2;
  text-align: center;
}

button {
  font: bold 24px Arial;
  background-color: black;
  color: lime;
  padding: 2px 6px 2px 6px;
  border-radius: 10px;
  border: 1px solid #CCCCCC;
}

#lead-photo {
  width: 300px;
  margin: auto;
  padding: 1em;
  border-radius: 50px;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Gallery</title>
  <link rel="stylesheet" href="stylesheets/gallery.css">
</head>

<body>
  <div class="container">
    <div class="box a">
      <h2>Image Gallery</h2>
    </div>
    <div class="box b photos">
      <img id="lead-photo" src="images/Stretched_Dachshund.jpg" align="middle">
    </div>
    <div class="box c">
      <h2>Next Image</h2>
      <button>Go!</button>
      <div></div>
    </div>
  </div>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  <script src="javascripts/gallery.js"></script>
</body>

</html>