Skip to content

Instantly share code, notes, and snippets.

@phirebase
Forked from debloper/index.html
Created March 24, 2017 08:42
Show Gist options
  • Save phirebase/4a913f1f03943ecc0be39040f76969ea to your computer and use it in GitHub Desktop.
Save phirebase/4a913f1f03943ecc0be39040f76969ea to your computer and use it in GitHub Desktop.
Pulsating HTML Element with just pinchful of CSS Animation
<!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>
#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