Last active
August 21, 2023 19:45
-
-
Save jalbertbowden/5874475 to your computer and use it in GitHub Desktop.
css transitions on background-image in WebKit - A CodePen by Cameron Adams.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><body><div></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://output.jsbin.com/yijenazuvo