Saturday 12 September 2020

How to create CSS text glow effect animation?

 

CSS text glow effect animation



Don't you want your site to seem attractive and user loving? I am sure you want to. You may have come up with an idea to make your website alive by using a glowing text effect to your content but don't know how to apply the CSS glowing text effect. Then, this article is for you.


I will discuss the CSS properties that can help you in creating a cool CSS glowing text effect as well as an example to show how to apply them. To create a CSS glowing text effect, you need to know two CSS properties-


  1. CSS animations
  2. CSS text-shadow

Let's discover how these two properties are useful in creating a CSS glowing text animation.


CSS animations:


CSS animations make it possible to animate an HTML element through the transition of CSS styles without the use of Javascript. To create CSS animations, you need to learn some properties. The CSS properties are-


  1. @keyframes,
  2. animation-name,
  3. animation-duration,
  4. animation-delay,
  5. animation-direction,
  6. animation-iteration-count,
  7. animation-timing-function,
  8. animation-fill-mode,
  9. animation

To learn the CSS animations property with interactive examples visit the following article- CSS animations


Text-shadow effect:


The CSS text-shadow effect adds a shadow to the text. For applying it, you have to specify the horizontal position, vertical position, blur radius, and color. You can add more than one shadows by adding a comma-separated list of the shadow properties. As you are creating glowing text, I would recommend setting the vertical position and horizontal position to Zero. You can set the blur-radius as much you want and the color that you wish.


Now, check the following code and I will discuss it.



See the Pen CSS glow text effect by KAMAL DAS (@daskamal)on CodePen.


In the above code, the following points should be followed carefully-


  1. the animation-duration property value should be less so that one can understand the glowing effect.
  2. Set the animation-iteration-count property value to infinite to keep the animation continuing.
  3. This is optional. You can set the animation-direction property to alternate. For more details visit- CSS animations
  4. In the @keyframes, the text-shadow blur-radius should have different values in the from{} and to{} so that the change can be visible.
  5. You can set the font-size and font-family and font color on your wish.


Congratulations on creating a CSS glowing text effect animation. Now, you can apply it and make your site more lively. If you have any doubts, let me know through your comments so that I can resolve it. If you like this article, please share it with your friends so that it can help them. For getting new posts and being updated, follow this blog.


Happy coding 😎.

No comments:

Post a Comment

SVG animation - Create walking man animation

  Don't you want your website to seem attractive? I am sure you want to. But, How can you do that? What about some animations? It will b...

–>