Can I have different colored links on my page?

liunx

Guest
Am I able to have different colored links on my page? I use the CSS method of controlling how my links look but I can't find a way to, for example, have the links in my title appear white with no underline while having the links in my paragraphs appear grey and underlined. Any way to code this?

Here is the current code for the css link color:

a:link {text-decoration:none;
color:#FFFFFF;}

This is for the white links I want in the top of the page. Now how do I have different colored links? Thanks in advance.Hi,

you can understand by this example.

<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE>
a{color:red;text-decoration:none};
p a{color:gray};
div a{color:green};

</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
</BODY>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"" class=".link_01_style">LINK 01</a><br>
<p>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"">LINK 02</a><br>
</p>
<div>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"">LINK 03</a><br>
</div>
</HTML>


Best regards
Deep DhyaniYou can use "style " at any time, which over-rides th class:

<a href='http://www.webdeveloper.com/forum/archive/index.php/whatever' style='text-decoration:none; color:#FFFFFF'>whatever</a>Ha! I didn't even think of that *slaps head*! Thanks people.Actually, i just thought of another problem with the style method. The things is that I want my link color in the body of my text to be black and then white when hovered over but in my header I want my links white but to turn black when hovered over. As far as I know there is no inline style command for that. Any ideas?Nevermind, I searched through the forums and saw that toicontien answered it perfectly:

We can't really help a whole lot unless you give us some more info (i.e. your HTML and CSS source). The easiest way is to create CSS classes:



/* General link colors */
a:link {
color: #[Hex color value];
}

a:visited {
color: #[Hex color value];
}

a:hover {
color: #[Hex color value];
}

a:focus {
color: #[Hex color value];
}

a:active {
color: #[Hex color value];
}


/* Menu link colors */
.menu:link {
color: #[Hex color value];
}

.menu:visited {
color: #[Hex color value];
}

.menu:hover {
color: #[Hex color value];
}

.menu:focus {
color: #[Hex color value];
}

.menu:active {
color: #[Hex color value];
}

Then to give the menu links the correct color:

<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" class="menu"></a>



Thanks!
 
Back
Top