Character walking animation Using CSS3 and HTML

Hello Coders, hope you all are doing well and today we see something new and very funny type thing which you guys like it very much, I hope.

Please comment below for a thumbs up.

Go below for a live view

So let’s start our code, start with HTML,

CharacterWalking.html


<!DOCTYPE html>
<html>
<head>
<title>Character Walking</title>
<link type="text/css" href="characterwalkinganimation.css">
</head>
<body>
<div class="runner"></div>
<div class="road"></div>
</body>
</html>

The main part of this task is the CSS code. For animate the character, we have to write CSS which I gave below,

characterwalkinganimation.css


body{
background: orange;
}
.road{
border-bottom: 7px dashed black;
}
.runner{
/*this is the image which is animated below*/
background: url("Cartoon.png") no-repeat;
width: 185px;
height: 290px;

/*code below shows the speed of the steps*/
animation: walk 1.2s steps(8) infinite,
forward 5s linear infinite;
}

/*Code below use for walking animation*/
@keyframes walk{
0%{
background-position: 0px;
}
100%{
background-position: -1472px;
}
}
@keyframes forward{
0%{
transform: translateX(-100px);
}
100%{
transform: translateX(1200px);
}
}

Above is the complete code of the character walking animation, you can try and also make your own.

If you want anything please comment below

Click here for image.

Live View

See the Pen Character walking animation Using CSS3 and HTML by Bikash Panda (@phpcodertech) on CodePen.

Happy Coding..!

Was this article helpful?
YesNo
My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH, my native place in Odisha. I am a Web Programmer by profession and working on more than 50 projects to date. My passion is working on the web-based project using PHP and relate to all CMS and frameworks which is based on PHP.
Posts created 163

3 thoughts on “Character walking animation Using CSS3 and HTML

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top
mariobet - supertotobet - escort -

takip7.com

We are now accepting Guest Posting and creation of Backlinks
This is default text for notification bar