Link to home
Start Free TrialLog in
Avatar of dhite99
dhite99

asked on

How to Change Link Font Color Inside a Table

I have a table defined as follows:

<table width="950" border="0" cellpadding="0" cellspacing="0" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New">
<tr>
<td width='81' class='class2'><a target=madetail href=tec.php?action=commands>commands</a></td>
<td width='100' class='class2'><a target=madetail href=tec.php?action=list>list</a></td>
</tr>

What I would like to do is to change the font color for the links to white. I tried adding font color=white, but that did't work. Appreciate any guidance.
Avatar of Morcalavin
Morcalavin
Flag of United States of America image

If you want to change just those links, you can add a class to your <style> tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
 
</script>
<style type="text/css">
	.link
	{
		color: #ffffff;
	}
	.link:hover
	{
		color: #ffffff;
	}
	.link:active
	{
		color: #ffffff;
	}
	.link:visited
	{
		color: #ffffff;
	}
</style>
<title>Untitled Document</title>
</head>
<body style="background-color:purple">
<a class="link" href="#">Test</a>
</body>
</html>

Open in new window

if you want to style the links inside the table differently than the rest of the web page, use inheritance in your css:
example:

table a {
  color: #abcdef;
}

table a:hover {
  color: #000000;
}

err.. don't know why i said "inheritance".  i mean Hierarchy
ASKER CERTIFIED SOLUTION
Avatar of edenmachine
edenmachine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhite99
dhite99

ASKER

Worked like a champ - THANKS!