🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
Introduction
Adding a glow effect to text in CSS can create a striking visual appearance, making the text stand out. This can be easily achieved using the text-shadow property to simulate the glow around the text.
In this tutorial, you'll learn how to create a glowing text effect using CSS by applying the text-shadow property.
Problem Statement
Create a CSS code that:
- Adds a glowing effect to text using the
text-shadowproperty. - Demonstrates how to control the color, blur, and spread of the glow.
Example:
- Input: A heading element with the text "Text Glow Effect".
- Output: The text appears with a glowing effect around it.
Solution Steps
- Use
text-shadowProperty: Apply thetext-shadowproperty to create a glowing effect around the text. - Control Glow Color and Blur: Adjust the color and blur radius to customize the glow effect.
HTML Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Glow Effect</title>
<style>
/* Step 1: Add a glowing effect using text-shadow */
.glow-text {
font-size: 3rem;
color: white;
text-shadow:
0 0 10px rgba(255, 255, 255, 0.8), /* soft white glow */
0 0 20px rgba(0, 255, 255, 0.8), /* cyan glow */
0 0 30px rgba(0, 255, 255, 0.8), /* brighter cyan glow */
0 0 40px rgba(0, 255, 255, 1); /* intense cyan glow */
font-family: Arial, sans-serif;
}
/* Center the text for better display */
.container {
text-align: center;
margin-top: 100px;
}
</style>
</head>
<body>
<div class="container">
<h1 class="glow-text">Text Glow Effect</h1>
</div>
</body>
</html>
Explanation
Step 1: Use text-shadow for Glowing Effect
To create a glowing effect, use the following CSS:
.glow-text { font-size: 3rem; color: white; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), /* soft white glow */ 0 0 20px rgba(0, 255, 255, 0.8), /* cyan glow */ 0 0 30px rgba(0, 255, 255, 0.8), /* brighter cyan glow */ 0 0 40px rgba(0, 255, 255, 1); /* intense cyan glow */ }The
text-shadowproperty defines multiple shadows that simulate the glow effect. Each shadow has different blur radii and opacity levels to create the glowing effect around the text.
Step 2: Customize the Glow Color and Intensity
- You can adjust the color and intensity of the glow by changing the
rgba()values and the blur radius in thetext-shadowproperty.
Output
Conclusion
Creating a text glow effect in CSS is simple using the text-shadow property. By adjusting the shadow color, blur radius, and opacity, you can create a glowing text effect that enhances your web design and draws attention to important elements.
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
ChatGPT + Generative AI + Prompt Engineering for Beginners
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
Testing Spring Boot Application with JUnit and Mockito
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
Available in Udemy for Business
Master Spring Data JPA with Hibernate
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
Available in Udemy for Business

Comments
Post a Comment
Leave Comment