How to create multicolor links in HTML?

1 replies
  • WEB DESIGN
  • |
Can anyone tell how to create multicolor links in HTML?
#create #html #links #multicolor
  • Profile picture of the author Tomos Wyn
    Something like this?

    HTML Code:
    <html>
    <head>
        <title>Test Link Colour</title>
        
        <style>
        a { color:#000; }
    
        a span.blue     { color:blue; }
        a span.red      { color:red; }
        a span.green    { color:green; }
        a span.orange   { color:orange; }
        a span.yellow   { color:yellow; }
        </style>
    </head>
    <body>
    
    <!-- link with 1 colour -->
    <a href="#link">Hello</a>
    
    <!-- link with Multiple colours -->
    <a href="#link">
        <span class="blue">H</span>
        <span class="red">E</span>
        <span class="green">L</span>
        <span class="orange">L</span>
        <span class="pink">O</span>
    </a>
    </body>
    </html>
    If so, you simple add a span around each letter in a link, then style those spans, like I did.

    Don't know if there is another way, but this is the first that came to my mind.
    {{ DiscussionBoard.errors[4346793].message }}

Trending Topics