How to create animation using HTML | CBSE Class 10 | Cyber Beans Chapter 3 | HTML | Prakhar Doneria
Write this code in HTML 5 editor:
<html>
<head>
<title>Page Title</title>
<style>
*{
padding:0px;
margin:0px;
background-color:black;
}
body {
height:100vh;
display:flex;
box-sizing:border-box;
justify-content:center;
align-items:center;
}
h1{
width:0ch;
overflow:hidden;
white-space:nowrap;
font-family:Sans-serif;
font-style:armenian;
letter-spacing:0px;
font-size:50px;
animation:html 5s infinite alternate steps(5);
border-right:3px solid black;
color:white;
}
@keyframes html{
0%{
width:0ch;
}
10%{
width:4ch;
}
20%{
width:7.5ch;
}
</style>
</head>
<body>
<h1>I❤️HTML</h1>
</body>
</html>
Comments
Post a Comment