Skip to content

Instantly share code, notes, and snippets.

@suxiaogang
Created July 17, 2019 07:40
Show Gist options
  • Save suxiaogang/7519cbdcebb20a55caf285c08b26b6a1 to your computer and use it in GitHub Desktop.
Save suxiaogang/7519cbdcebb20a55caf285c08b26b6a1 to your computer and use it in GitHub Desktop.
simple css hover to expand
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
-webkit-transition: width 2s, height 4s; /* For Safari 3.1 to 6.0 */
transition: height 0.4s;
}
div:hover {
height: 300px;
}
</style>
</head>
<body>
<h1>The transition Property</h1>
<p>Hover over the div element below, to see the transition effect:</p>
<div></div>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment