-
-
Save phirebase/4a913f1f03943ecc0be39040f76969ea to your computer and use it in GitHub Desktop.
Pulsating HTML Element with just pinchful of CSS Animation
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> | |
<head> | |
<title>CSS Pulsator</title> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
</head> | |
<body> | |
<div id="pulsor">Pulsate!</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
#pulsor { | |
width: 120px; | |
margin: 64px; | |
padding: 16px 32px; | |
font-size: 32px; | |
cursor: auto; | |
border-radius: 8px; | |
box-shadow: 0 0 10px #333; | |
} | |
#pulsor:hover { | |
-webkit-animation: pusate 1s infinite alternate; | |
-moz-animation: pusate 1s infinite alternate; | |
-animation: pusate 1s infinite alternate; | |
text-shadow: 0 0 8px #ccc; | |
} | |
@-webkit-keyframes pusate { | |
from { box-shadow: 0 0 10px #333; } | |
to { box-shadow: 0 0 20px #c00; } | |
} | |
@-moz-keyframes pusate { | |
from { box-shadow: 0 0 10px #333; } | |
to { box-shadow: 0 0 20px #c00; } | |
} | |
@keyframes pusate { | |
from { box-shadow: 0 0 10px #333; } | |
to { box-shadow: 0 0 20px #c00; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment