Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COLORS OF HYPERLINKS 3

Status
Not open for further replies.

Rohdem

Programmer
Sep 20, 2000
553
0
0
US
I want the color of my hyperlinks to be the same whether it is visited, not visted, or active, but I have 2 tables and I want the hyperlinks one color in one table and another color in another table. Is this possible?

I just know the basic HTML stuff. If I try using the <body> tag and vlink, etc, it changes the links for the whole page. Is there a property I can use to set this at the table level?

Thanks!!
 
Declare an id for each table, like this:

Code:
<table id="tbl1">
  ...
</table>

<table id="tbl2">
  ...
</table>

Then, in the <head></head> tags, have this:

Code:
#tbl1 a:link { color: red; }
#tbl1 a:visited { color: red; }
#tbl1 a:hover { color: red; }
#tbl1 a:active { color: red; }

#tbl2 a:link { color: blue; }
#tbl2 a:visited { color: blue; }
#tbl2 a:hover { color: blue; }
#tbl2 a:active { color: blue; }

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Hi,

Thanks for the response.

When I try this, the '#tbl1 a:link { color: red; }......' stuff just appears in the browser. Am I missing something??

Thanks!!
 
Yeah, you are missing the <style> tag. Try

Code:
<head>
<style>
#tbl1 a:link { color: red; }
#tbl1 a:visited { color: red; }
#tbl1 a:hover { color: red; }
#tbl1 a:active { color: red; }

#tbl2 a:link { color: blue; }
#tbl2 a:visited { color: blue; }
#tbl2 a:hover { color: blue; }
#tbl2 a:active { color: blue; }
</style>
</head>
[code]
 
err...

Code:
<head>
<style>
#tbl1 a:link { color: red; }
#tbl1 a:visited { color: red; }
#tbl1 a:hover { color: red; }
#tbl1 a:active { color: red; }

#tbl2 a:link { color: blue; }
#tbl2 a:visited { color: blue; }
#tbl2 a:hover { color: blue; }
#tbl2 a:active { color: blue; }
</style>
</head>
 
That works perfect, thanks for the help everyone!!!

Clive...it does matter to me, that is much shorter!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top