Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jalbertbowden/5874475 to your computer and use it in GitHub Desktop.
Save jalbertbowden/5874475 to your computer and use it in GitHub Desktop.
css transitions on background-image in WebKit - A CodePen by Cameron Adams.
html {
height: 100%;
}
body {
height: 100%;
}
div {
position: absolute;
left: 50%;
top: 50%;
width: 500px;
height: 500px;
margin: -250px 0 0 -250px;
background-image: url(http://i.imgur.com/tmM8Bpy.jpg);
-webkit-transition: background-image 0.5s linear;
}
div:hover {
background-image: url(http://i.imgur.com/FWqOONj.jpg);
}
@unyo
Copy link

unyo commented Aug 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment