Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Created February 13, 2016 17:33
Show Gist options
  • Save ericakfranz/52ea2d0b114a24433d5a to your computer and use it in GitHub Desktop.
Save ericakfranz/52ea2d0b114a24433d5a to your computer and use it in GitHub Desktop.
Position title over image and show only on hover.
/* Position title and hide it by default */
.envira-gallery-item-inner .title {
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
/* Optional: add transitions so the title smoothly fades in/out on hover */
-webkit-transition: opacity 0.5s ease;
-moz-transition: opacity 0.5s ease;
-o-transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
}
/* Show title on hover */
.envira-gallery-item-inner:hover .title { opacity: 1; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment