How to make HTML links in different colors

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

How can I make the HTML links in different colors?

Please advise the easiest way to do it as I am totally clueless about it.

Thanks!

SHARE
Best Answer by mrana07
Best Answer
Best Answer
Answered By 0 points N/A #103140

How to make HTML links in different colors

qa-featured

You can make HTML links in different colors by 2 ways.

1. Using HTML Code

2. Using CSS Code

1. Using HTML Code

In your <BODY> tag just type the following HTML code

<body link="#FF00FF" alink="#00FF00" vlink="#0000FF">

You can use color name or hexadecimal code

Link  shows the color value you want to apply to the unselected links on your page.

Alink shows the color value you want to apply to active links on your page.

Vlink shows color value you want to apply to the previously visited links on your page.

2.      Using CSS Code

  • In your stylesheet Type A:? { } to identify the link tag, replacing with the type of link you want to change (link, visited, or active).
  • Click between the { } and type color: and a space.
  • Type the color name or hexadecimal code you want to assign

You can use the CSS code

Body(font-family: “Arial”, “Verdana”)

A:link { color: #FF00FF}

Answered By 590495 points N/A #103141

How to make HTML links in different colors

qa-featured

Normally in an HTML webpage, setting the colors are normally done within the CSS file. The colors are applied using the properties “background-color” and “color”. These properties are normally written in these formats:

  • body {
  •  background-color: #000;
  •  color: #000;
  • }

If you have no idea how to get the value “#000” for a specific color, you can use Adobe Photoshop. Here’s an example using Adobe Photoshop CS2. Start Adobe Photoshop CS2 and then pick a color in Swatches tab. See image.

Once you select a color, it will appear on the left panel. On the left panel or sidebar, click on the color you selected. See image.

Move the slider up or down to adjust the color. You can also move the small circle in the display box to adjust the color. See image.

Once the color has been decided, copy the numbers or the value next to “#”. You can use this value in applying the color for your hyperlinks or in the body of the webpage. See image.

  • body {
  •  background-color: #5574b9;
  •  color: #000;
  • }

“#000” or “#000000” is equivalent to black and “#ffffff” for white.

Related Questions