Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Box color CSS transition
<!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>
.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
You can’t perform that action at this time.