Skip to content

Instantly share code, notes, and snippets.

@ivalexandru
Created August 4, 2018 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivalexandru/4191c60d24da817d5bc0cc8cfd23ebdd to your computer and use it in GitHub Desktop.
Save ivalexandru/4191c60d24da817d5bc0cc8cfd23ebdd to your computer and use it in GitHub Desktop.
css_animatii_bounceBall
<!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