How to add a smooth color fade animation to text

1 week ago 16
ARTICLE AD BOX

I’m creating a simple portfolio website and I want my header text (<h1>) to fade smoothly between multiple colors continuously.

At the same time, I want to include a copyright/credit in the footer that is present in the HTML but invisible on the page.

body { font-family: Arial, sans-serif; text-align: center; padding: 50px; background: #f9f9f9; } /* Header color fade animation */ h1 { font-size: 48px; animation: colorFade 5s infinite alternate; } @keyframes colorFade { 0% { color: blue; } 50% { color: green; } 100% { color: red; } } /* Footer with hidden credit */ footer { margin-top: 100px; font-size: 0.9em; } .hidden-credit { display: none; } <!-- Source - https://stackoverflow.com/q/79874952 Posted by Huf48500 Retrieved 2026-01-23, License - CC BY-SA 4.0 --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Portfolio Huf48500</title> </head> <body> <header> <h1>Huf48500 / HufHuf48</h1> <p>IT student | Passionate about cybersecurity and development</p> </header> <footer> <p>Thank you for visiting!</p> <p class="hidden-credit">© Huf48500 / HufHuf48 — GitHub: <a href="https://github.com/HufHuf48">HufHuf48</a></p> </footer> </body> </html>

Thanks in advance for any tips or alternative solutions!

Read Entire Article