Created
August 4, 2018 13:11
-
-
Save ivalexandru/4191c60d24da817d5bc0cc8cfd23ebdd to your computer and use it in GitHub Desktop.
css_animatii_bounceBall
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="styles.css"> | |
<style> | |
#ball { | |
width: 100px; | |
height: 100px; | |
margin: 50px auto; | |
position: absolute; /* daca pui relative aici, se misca si paragraful */ | |
border-radius: 50%; | |
background: linear-gradient( | |
35deg, | |
#ccffff, | |
#ffcccc | |
); | |
animation-name: bounce; | |
animation-duration: 4s; | |
animation-iteration-count: infinite; | |
} | |
@keyframes bounce{ | |
0% { | |
top: 0px; | |
} | |
50% { | |
top: 249px; | |
width: 130px; | |
height: 70px; | |
} | |
100% { | |
top: 0px; | |
} | |
} | |
</style> | |
<script> | |
</script> | |
</head> | |
<body> | |
<h1>titlul<h1> | |
<div id="ball"></div> | |
<br> | |
<p>paragraful</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment