Image Lightbox with Captions

by Ken Watanabe

HTML

<a href="#img1">
    <img src="http://kenwatanabe.info/media/mj_10_thumb.jpg"/>
</a>

<a href="#_" class="lightbox" id="img1">
    <img src="http://kenwatanabe.info/media/mj_10_thumb.jpg"/>
</a>

CSS

.lightbox {
    visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.5s linear;
/*   display:none;
   */    position: fixed;
    z-index: 999;
    width: 100%;
    height: 100%;
    text-align: center;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.lightbox:target {
    outline: none;
    visibility: visible;
  opacity: 1;
/*     display: block;
     */}