learn css animation
CSS
Read this helpful, short and straightforward article to learn CSS animation perfectly.
https://medium.com/@Cafe_Code/learn-css-animation-asap-as-simple-as-possible-374b7874d4dd<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
position: relative;
animation: myfirst 5s linear 2s infinite alternate;
}
@keyframes myfirst {
0% {background-color:red; left:0px; top:0px;}
25% {background-color:yellow; left:200px; top:0px;}
50% {background-color:blue; left:200px; top:200px;}
75% {background-color:green; left:0px; top:200px;}
100% {background-color:red; left:0px; top:0px;}
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
<div><p>you can add text in this box or anithing else like a pictrue</p></div>
</body>
</html><style>
#ball {
width: 100px;
height: 100px;
margin: 50px auto;
position: relative;
border-radius: 50%;
background: linear-gradient(
35deg,
#ccffff,
#ffcccc
);
/*"Call" the animation "function" */
animation-name: bounce;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-delay: 2s;
/* Normal, reverse, alternate(between the fwd and back)
and alternate-reverse */
animation-direction: reverse;
/* Ease is deafault, use cubic-bezier(n,n,n,n) for custom */
animation-timing-function: linear;
/* if you want something to display from hidden
set the opacity to 0 and in the keyframe steps bring
the opacity to 1 gradually to stop it flashing */
}
/* The animation "bounce" */
@keyframes bounce{
/* start */
0% {
top: 0px;
}
/* step (you can add multiple incremental steps from 1-100) */
50% {
top: 249px;
width: 130px;
height: 90px;
}
/* end (you can count down from 100 to 0 too) */
100% {
top: 0px;
}
}
</style>
<div id="ball"></div>//css keyframes
#image{
width: 100px;
height: 100px;
background-color: red;
position: relative;
animation: monFrame 5s linear 2s infinite alternate;
}
@keyframes monFrame {
0% {left:0px; top:0px;}
25% {left:500px; top:0px;}
50% {left:500px; top:500px;}
75% {left:0px; top:500px;}
100% {left:0px; top:0px;}
} CSS animation properties template:
{
animation-name: anima-name;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-delay: 2s;
animation-direction: reverse | normal | alternate | alternate-reverse ;
animation-timing-function: ease | ease-out | ease-in | ease-in-out | linear | cubic-bezier(x1, y1, x2, y2) (e.g. cubic-bezier(0.5, 0.2, 0.3, 1.0));
animation-fill-mode:forwards | backwards | both | none;
}
@keyframes anima-name {
from {
background-position:right;
}
to {
background-position:left;
}
}
@keyframes anima-name {
0% {
background-color: red;
}
50% {
background-color: green;
}
100% {
background-color: red;
}
}
@-webkit-keyframes pulse {
0% {
background-color: red;
opacity: 1.0;
-webkit-transform: scale(1.0) rotate(0deg);
}
33% {
background-color: blue;
opacity: 0.75;
-webkit-transform: scale(1.1) rotate(-5deg);
}
67% {
background-color: green;
opacity: 0.5;
-webkit-transform: scale(1.1) rotate(5deg);
}
100% {
background-color: red;
opacity: 1.0;
-webkit-transform: scale(1.0) rotate(0deg);
}
}
.pulsedbox {
-webkit-animation-name: pulse;
-webkit-animation-duration: 4s;
-webkit-animation-direction: alternate;
-webkit-animation-timing-function: ease-in-out;
}
Also in CSS:
- Title
- Unable to load authentication plugin 'caching_sha2_password'. dbeaver
- Category
- CSS
- Title
- fullcalendar react
- Category
- CSS
- Title
- css color gradient background full height
- Category
- CSS
- Title
- image rotate css
- Category
- CSS
- Title
- tint image css
- Category
- CSS
- Title
- change background input css
- Category
- CSS
- Title
- tint image with background color css
- Category
- CSS
- Title
- Jquery .css
- Category
- CSS
- Title
- css erase text
- Category
- CSS
- Title
- css text shadow not showing in mac chrome
- Category
- CSS
- Title
- bootstrap 4 mobile media query
- Category
- CSS
- Title
- change color select arrow css cf7
- Category
- CSS
- Title
- hwo to make a round corners with css
- Category
- CSS
- Title
- css all caps
- Category
- CSS
- Title
- css ios disable zoom
- Category
- CSS
- Title
- css overflow-y scroll
- Category
- CSS
- Title
- how to align elements horizontally in css
- Category
- CSS
- Title
- absolute path and relative path
- Category
- CSS
- Title
- css italics
- Category
- CSS
- Title
- image blur css
- Category
- CSS
- Title
- kotlin exit app
- Category
- CSS
- Title
- coding that removes list marker from nav in css
- Category
- CSS
- Title
- how to call an id in css
- Category
- CSS
- Title
- background image with color overlay gradient css
- Category
- CSS
- Title
- how to style an hr tag
- Category
- CSS
- Title
- textview android text align center
- Category
- CSS
- Title
- clear both css
- Category
- CSS
- Title
- bem in nested element
- Category
- CSS
- Title
- css gradient text
- Category
- CSS
- Title
- multilayer shadow in css
- Category
- CSS
- Title
- css center text
- Category
- CSS
- Title
- how to create popup css
- Category
- CSS
- Title
- set items inline html
- Category
- CSS
- Title
- vh in css
- Category
- CSS
- Title
- mobile tablet desktop media queries
- Category
- CSS
- Title
- css vertical center
- Category
- CSS
- Title
- make an image size down to accommodate screen size
- Category
- CSS
- Title
- linear gradient css
- Category
- CSS
- Title
- css horizontal gradient background color
- Category
- CSS
- Title
- javascript remoev css class
- Category
- CSS
- Title
- static css in django
- Category
- CSS
- Title
- css animation linear
- Category
- CSS
- Title
- css white-space
- Category
- CSS
- Title
- disable bullets in ul
- Category
- CSS
- Title
- how to stilize title property css
- Category
- CSS
- Title
- How to prevent anchor links from scrolling behind a sticky header with one line of CSS
- Category
- CSS
- Title
- javascript css link append
- Category
- CSS
- Title
- css vw scrollbar
- Category
- CSS
- Title
- spring boot
- Category
- CSS
- Title
- css preprocessor
- Category
- CSS
- Title
- transform rotate css
- Category
- CSS
- Title
- HTML & CSS: Design and Build Web Sites
- Category
- CSS
- Title
- large input box bootstrap 4
- Category
- CSS
- Title
- css flex property
- Category
- CSS
- Title
- button href
- Category
- CSS
- Title
- how to style input fields in css
- Category
- CSS
- Title
- add sucssess message laravel
- Category
- CSS
- Title
- z-index max value
- Category
- CSS
- Title
- for loops in cpp
- Category
- CSS
- Title
- how to center a div in css
- Category
- CSS
- Title
- materializecss
- Category
- CSS
- Title
- css calc height
- Category
- CSS
- Title
- button width based on text csss
- Category
- CSS
- Title
- typewriter effect css
- Category
- CSS
- Title
- how do i make a div full width with css
- Category
- CSS
- Title
- css ellipsis max width
- Category
- CSS
- Title
- how to bring logo in line with nav bar using css
- Category
- CSS
- Title
- focus um elemento altera outro css
- Category
- CSS
- Title
- clear postgres terminal
- Category
- CSS
- Title
- @media css
- Category
- CSS
- Title
- css background image opacity
- Category
- CSS
- Title
- display flex css
- Category
- CSS
- Title
- adding css to html body
- Category
- CSS
- Title
- tzutc
- Category
- CSS
- Title
- get rid of arrows number input
- Category
- CSS
- Title
- jquery css importnat
- Category
- CSS
- Title
- como fazer uma linha vertical no html
- Category
- CSS
- Title
- css hero image
- Category
- CSS
- Title
- typescript not supporting scss
- Category
- CSS
- Title
- text unselectable css
- Category
- CSS
- Title
- not disabled css
- Category
- CSS
- Title
- inline style css syntax
- Category
- CSS
- Title
- font-style css
- Category
- CSS
- Title
- css change background color of page
- Category
- CSS
- Title
- css php
- Category
- CSS
- Title
- vertical multi color border css
- Category
- CSS
- Title
- overlay in css
- Category
- CSS
- Title
- css important
- Category
- CSS
- Title
- convert image in rounshape in css
- Category
- CSS
- Title
- how to change the background color in css
- Category
- CSS
- Title
- what is rem in css
- Category
- CSS
- Title
- import css
- Category
- CSS
- Title
- row class in bootstrap
- Category
- CSS
- Title
- hide scrollbar html css
- Category
- CSS
- Title
- css tricks media queries
- Category
- CSS
- Title
- css parent selector
- Category
- CSS
- Title
- css remove list indent
- Category
- CSS
- Title
- how to do a background blur in css
- Category
- CSS
- Title
- how to apply bg image in inline css
- Category
- CSS
- Title
- comment out css
- Category
- CSS