Make a CSS Heartbeat using an Infinite Animation Count
Here's one more continuous animation example with theanimation-iteration-countproperty that uses the heart you designed in a previous challenge.
The one-second long heartbeat animation consists of two animated pieces. Theheartelements (including the:beforeand:afterpieces) are animated to change size using thetransformproperty, and the backgrounddivis animated to change its color using thebackgroundproperty.
Keep the heart beating by adding theanimation-iteration-countproperty for both thebackclass and theheartclass and setting the value toinfinite. Theheart:beforeandheart:afterselectors do not need any animation properties.