Hi there,
It's probably just a typo, but color: #red won't work.
It has to be color: red or color: #FF0000
Using:
Code CSS:
a:link {color: blue; text-decoration: none; }
will affect the style of all of the links in your document (unless they have been specifically styled otherwise).
Obviously you can only do that once.
You can however, drill down your CSS selectors to style links on different parts of the page differently.
Have a look at the following example:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Link styling example</title>
<style>
a{color:red}
.special a{color:yellow;}
#special a{color:green;}
</style>
</head>
<body>
<p><a href="#">A link</a> Some interesting content</p>
<p class="special"><a href="#">Link two</a> Some more interesting content</p>
<div id="special"><a href="#">Link three</a> Even more interesting content</div>
<a href="#">Another link</a>
</body>
</html>
Can you see how we set the default link colour to red with this a{color:red}, then by using .special a{color:yellow;} we can style all of the links contained within an element which has a class of "special" differently, and finally using #special a{color:green;} we can style all of the links contained within an element which has a id of "special" differently again.
You should be able to use this to do what you want.
But if you still can't get it to work, post a link to your page and I'll gladly have a look.
Bookmarks