Skip to content

Instantly share code, notes, and snippets.

@jessestu
Last active August 19, 2018 22:22
Show Gist options
  • Save jessestu/46b5c9f5fa2c8c7a0c07d6552dcb801a to your computer and use it in GitHub Desktop.
Save jessestu/46b5c9f5fa2c8c7a0c07d6552dcb801a to your computer and use it in GitHub Desktop.
/* Replaces the Header Image on hover. / @jessestu 3701943-hc */
/* First, set the default background image */
.header-image a {
background-image: url('https://miglenovadesign.files.wordpress.com/2017/09/cropped-header-295-2.jpg');
}
/* Second, set the :hover image */
.header-image a:hover {
background-image: url('https://miglenovadesign.files.wordpress.com/2018/06/color21.jpg');
background-size: 100%;
}
/* Hide the image there originally, as the original image can't be replaced on hover. */
.header-image a img {
visibility: hidden;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment