title: CSS-Only Picture/Thumbnail Gallery
body: <p>Although I've looked at many CSS-only scripts, I cannot figure out how to display the first image by default rather than have a blank space when this first opens. This must be CSS only - javascript and other "active content" not allowed. Please advise.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    width: 600px;
    position: relative;
  }
  
  .gallerycontainer {
    position: relative;
    height: 600px;
    /*Add a height attribute and set to largest image's height to prevent overlaying*/
  }
  
  .thumbnail img {
    border: 1px solid white;
    margin: 0 5px 5px 0;
  }
  
  .thumbnail:hover {
    background-color: transparent;
  }
  
  .thumbnail:hover img {
    border: none;
  }
  
  .thumbnail span {
    /*CSS for enlarged image*/
    position: absolute;
    background-color: lightyellow;
    padding: 5px;
    left: -1000px;
    border: none;
    visibility: hidden;
    color: black;
    text-decoration: none;
  }
  
  .thumbnail span img {
    /*CSS for enlarged image*/
    border-width: 0;
    padding: 2px;
  }
  
  .thumbnail:hover span {
    /*CSS for enlarged image*/
    visibility: visible;
    top: 0;
    left: 150px;
    /*position where enlarged image should offset horizontally */
    z-index: 50;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="gallerycontainer"&gt;
    &lt;div class="container"&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="thumbnail" href="#thumb"&gt;&lt;img border="0" src="http://www.placehold.it/500" width="60" /&gt;&lt;span&gt;&lt;img src="http://www.placehold.it/500" width="500" /&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>