Created
July 17, 2019 07:40
-
-
Save suxiaogang/7519cbdcebb20a55caf285c08b26b6a1 to your computer and use it in GitHub Desktop.
simple css hover to expand
This file contains hidden or 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> | |
<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