A029j3a2a - Keyframes (from and to)

CSS keyframes allow you to animate elements. In the following examples, we specify animation names for the elements and provide a @keyframes code block. These are simple animations that change from a beginning to end state using the from{} and to{} code blocks.


Here are additional properties to learn:

Background-Color
Height
Transform/Rotation
Border-Radius
Transform/Translate
Transform/Rotate
Transform/Scale

Example of element code and the binded animation.

        /* Animated elements */	
    #black
    {
	    background-color: black;
	    animation-name:changecolor;
	    animation-duration:4s;
	}

    @keyframes changecolor
    {
	    from
	    {
	    background-color: black;
	    }
	    to
	    {
	    background-color: red;
	}
	
}
    
dmarq-s005@chusd.org