ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • What is ReadOnly and Disabled attribute in HTML?
  • How to Integrate reCAPTCHA in your website?
  • CSS Animation with cubic-bezier()
  • Simple Scroll Effect using JavaScript+JQuery.
  • Invalid Scopes: pages_manage_instant_articles. This message is only shown to developers. Users of your app will ignore these permissions if present
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

Typewriter Effect using CSS

Client Side CSS about 6 years ago || 6/3/2019 || 3.5 K View

  • Hide

1. Basic Typewriter Effect without cursor:-

  • Output:-               

  • HTML Input:-

 <div class="typewriter">
    <h1>Hello World!!!</h1>
 </div>
  • CSS Input:-

.typewriter h1 {
    overflow: hidden; /* To hide the content until the animation is complete */
    white-space: nowrap; /* To keep content in a single line */
    letter-spacing: .10em; /* Gap between the letters */
    animation: typing 4.5s steps(40, end);
}

/* The typing effect */
@keyframes typing {
    from {
        width: 0% /* Animation Starting Point */
    }

    to {
        width: 100% /* Animation Stoping Point*/
    }
}

Here, @keyframes is the CSS property which specifies the animation code. It is used to explicitly execute the animation properties when applied.

 

2. Typewriter Effect Styling with Cursor:-

  • Output:-

  • CSS Input:-

           By adding the following CSS property in the above-mentioned CSS Input, we can achieve the given output:-

border-right: .10em solid blue; /* Cursor Styling */

 

  • Output:-

  • CSS Input:-

           By adding the following CSS property in the above-mentioned CSS Input, we can achieve the given output:-

.typewriter h1{
animation: typing 4.5s steps(40, end),
           blink .65s step-end infinite;
}
/*Cursor Blink Effect*/
@keyframes blink {
    50% {
        border-color: black;
    }
}


Some tips for using the Typewriter Effect in CSS:-

  • Use "font-family: monospace;" for better styling as all the letter under monospace will have equal width.

  • CSS Syntax for Animation:

animation: name duration timing-function delay iteration-count direction fill-mode play-state;

 

  • 0
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Bani Maharjan

Bani Maharjan

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey