Fri May 20 2022

Text Typing Animation

CSS5317 views

File Name: typing-text-animation.html

<!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">
    <title>Typing Text Animation without JavaScript</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@700&display=swap" rel="stylesheet"> 
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Comfortaa', cursive;
        }

        body {
            background-color: #383838;
        }

        section {
            width: 100%;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }

        ul {
            list-style: none;
            height: 60px;
            overflow: hidden;
        }

        ul li {
            color: #fff;
            font-size: 50px;
            line-height: 60px;
            position: relative;
            top: 0;
            margin: 0;
            animation: scrolling 8s steps(4) infinite;
        }

        ul li:nth-child(1) { color: #75f80a; }

        ul li:nth-child(2) { color: #f8610a; }

        ul li:nth-child(3) { color: #f8f40a; }

        ul li:nth-child(4) { color: #15b5ff; }

        ul li::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            background-color: #383838;
            border-left: 2px solid #fff;
            animation: typing 2s steps(10) infinite;
        }

        @keyframes typing {
            100% {
                left: 100%;
                margin: 0 -35px 0 35px;
            }
        }

        @keyframes scrolling {
            100% {
                top: -240px;
            }
        }
        
    </style>
</head>
<body>
    <section>
        <ul>
            <li>Hello Geek!</li>
            <li>Hello Nerd!</li>
            <li>Welcome to</li>
            <li>Geekboots</li>
        </ul>
    </section>
</body>
</html>

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.