Text Grow And Shrink Animation

 


 

Learn how to create Text Grow And Shrink using only using only HTML and CSS.

Watch the tutorial video here-

 



The VS Code extensions used in this video are Live Server, Bracket Pair Colorizer, and Prettier.

 

HTML Source Code-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="text animation.css">
    <title>Document</title>
</head>
<body>
    <div class="container">
        <span class="text1">Welcome to</span>
        <span class="text2">The Code Breaker</span>
    </div>
</body>
</html>

  

Download HTML source file

 

CSS Source Code-

 

*{
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

body{
    background: #000;
}

.container{
    position: absolute;
    top: 50%;
    left:50%;
    transform: translate(-50%,-50%);
    text-align: center;
    width: 100%;
}

.container span{
    display: block;
    text-transform: uppercase;
    animation: text 3s infinite;
}

.text1{
    color: white;
    font-size: 75px;
    font-weight: bold;
    margin-bottom: 10px;
}

.text2{
    font-size: 40px;
    color: #ff4540;
}

@keyframes text {
    0%{
        color: transparent;
        letter-spacing: -28px;
    }
    50%{
        letter-spacing: 14px;
    }
    100%{
        letter-spacing: 2px;
    }
}

  

Download CSS source file

 

Post a Comment

0 Comments