Manna Manna - 2 months ago 5
CSS Question

How do I add different colors to each word in a hyperlink in HTML?

The exact question was : Write an HTML program which includes a single hyperlink containing three words with each word displayed in a different color. Eg: "JavaScript WebProgramming CSS" (JavaScript in green, WebProgramming in red, CSS in yellow).

Answer

It is as easy as this!

<a href="https://so.com"><x style="color:green">JavaScript</x> <x style="color:red">WebProgramming</x> <x style="color:yellow">CSS</x></a>