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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS inside HREF

Status
Not open for further replies.

desperateSpider

Programmer
May 25, 2001
3
AE
hi guys,
i'm usin' the followin' CSS to affect all the document:

<style type=&quot;text/css&quot;>
<!--
a:link, a:visited, a:hover {color:#ffffe5}
-->
</style>

it works, but i want one link in the document to have the color '000000', so how can i use the CSS inside the HREF tag to affect only this link, not all the document?!

to get my point, check this piece of HTML code:

<table>
<tr>
<td bgcolor=&quot;142A69&quot;><a href=&quot;&quot;>Link 1</a></td>
<td bgcolor=&quot;142A69&quot;><a href=&quot;&quot;>Link 2</a></td>
<td bgcolor=&quot;ffffe5&quot;><a href=&quot;&quot;>Link 3</a></td>
</tr>
</table>

the problem with Link 3, the bgcolor is 'ffffe5' and i want the link color to be '000000'.

thanx for help.
 
Try this:

<style type=&quot;text/css&quot;>
<!--
.LINK1:link, .LINK1:visited, .LINK1:hover {color:#ffffe5}
-->
</style>

<table>
<tr>
<td><a class=&quot;LINK1&quot; href=&quot;&quot;>Link 1</a></td>
<td><a class=&quot;LINK1&quot; href=&quot;&quot;>Link 2</a></td>
<td><a class=&quot;LINK1&quot; href=&quot;&quot;>Link 3</a></td>
</tr>
</table> Mike Barone
FREE CGI/Perl Scripts & JavaScript Generators
Ace PopUp Generator Software - Totally FREE
 
hi,
what mike barone suggested is more than enough.......but in case u want to change only for that link 3 then try this

<table>
<tr>
<td bgcolor=&quot;142A69&quot;><a href=&quot;&quot;>Link 1</a></td>
<td bgcolor=&quot;142A69&quot;><a href=&quot;&quot;>Link 2</a></td>
<td bgcolor=&quot;ffffe5&quot;><a href=&quot;&quot; style='background-color:#000000'>Link 3</a></td>
</tr>
</table>

this is incase u want link3 to have background colour as black (i.e #000000)...or in case u want only the text to appear in black colour....

replace background-color with just color



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top