How to create multicolor link in HTML?

Asked By 0 points N/A Posted on -
qa-featured

I wanted to make a multicolor link using HTML? Is it possible? If yes, how could I make one? Any help would be appreciated.

SHARE
Answered By 0 points N/A #116764

How to create multicolor link in HTML?

qa-featured

Hi Thomas,

There are few solutions regarding your question in creating multi color links in HTML. Below are some solutions that might help but its better if you follow the exact codes.

You may specify the color of links for the total page following LINK andVLINK aspect inside the initial BODY tag as follows:

<body link="yellow" vlink="yellow">


<a href="/tips/">
This link will be yellow.
</a>

</body>

But, how may you contain one link colored in red, another in green. You may notice how the given way does not work:

<font color="red">

<a href="/tips/internet/">
Internet
</a>
</font>

<br>

<font color="green">
<a href="/tips/windows/">
Windows
</a>
</font>

<br>

<font color="blue">
<a href="/tips/programming/">
Programming
</a>
</font>

Try taking above tags and moving FONT tags inside A tags (anchor or link) as follows:

<a href="/tips/internet/">

<font color="red">
Internet
</font>
</a>

<br>

<a href="/tips/windows/">
<font color="green">
Windows
</font>
</a>

<br>

<a href="/tips/programming/">
<font color="blue">
Programming
</font>
</a>

There is also another way in having multi color links.

Try to apply CSS o assign your color and then try to apply them later in the actual like. In the below code example, you would place the below CSS code into the <HEAD> portion of your web page. This assigns the two color names and colors using HTML color codes.

<style type="text/css">

.blue {color: #00f;}
.green {color: #008000;}
</style>

 

Next, is the actual link containing span tags that used the above CSS defined colors within the link.

<a href="index.htm"><span class="green">Computer</span>

<span class="blue">Hope</span></a>

Now here’s another solution:

<a href="index.htm"><font color="green">Computer</font>

<font color="blue">Hope</font></a>

Hope that solves your query. It should work.

Login/Register to Answer

Related Questions