Link colors
Moderator: General Moderators
Link colors
I use CSS to change how the links look (when mouse over etc.)
However this applies to the whole page. How can I do that to each link or to all links in a table cell separately?
However this applies to the whole page. How can I do that to each link or to all links in a table cell separately?
for exemple you create that in your css
and in your code you make
you can create as many sub class as you want..
Code: Select all
a.smallmenu {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
text-decoration: none;
color: #7D85BD;
}
a:hover.smallmenu {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
text-decoration: none;
color: #3E498E;
}Code: Select all
<a href="home_fr.php" class="smallmenu">home</a>-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Find a website that does this and look at their code. It should just be the same .hover css, but applied to the <td> background instead of the link:
Code: Select all
.highlight.hover {
background: #FF1111;
}
<table>
<tr>
<td class="highlight">
Test
</td>
</tr>
</table>Use
This also goes for td.tdname or tr.trname. You should use them as per the following:
If you use them in the <td> or <tr> elements place the class in the tag.
Good Luck!
Code: Select all
table.tablename a
{
color: #FF0000;
}
table.tablename a:hover, a:visited
{
color : #0000FF;
}Code: Select all
<table width="500" border="0" cellspacing="0" cellpadding="5" class="tablename">
<tr>
<td><a href="#">link</a></td>
</tr>
</table>Good Luck!
thanks man!coreyb wrote:UseThis also goes for td.tdname or tr.trname. You should use them as per the following:Code: Select all
table.tablename a { color: #FF0000; } table.tablename a:hover, a:visited { color : #0000FF; }If you use them in the <td> or <tr> elements place the class in the tag.Code: Select all
<table width="500" border="0" cellspacing="0" cellpadding="5" class="tablename"> <tr> <td><a href="#">link</a></td> </tr> </table>
Good Luck!