Last active
October 8, 2017 03:26
-
-
Save freshcutdevelopment/5c36cc18086d8b8d3191bbd983fc68a2 to your computer and use it in GitHub Desktop.
Box color CSS transition
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS Transition Example</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<div class="box"></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
.box{ | |
width:200px; | |
height:200px; | |
background-color:blue; | |
-webkit-transition: background-color 0.5s ease; | |
-moz-transition: background-color 0.5s ease; | |
-o-transition: background-color 0.5s ease; | |
transition: background-color 0.5s ease; | |
} | |
.box:hover { | |
background-color: red; | |
cursor: pointer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment