cdewsnip
07-26-2006, 07:16 AM
Is it possible to override the link styles that have been applied to a certain style? I have a style called listingpage which defines the links in the table as being normal grey text. However, I also want to put in links within the listing section which are blue and bold. How do I override the style that I assigned to the listingpage style? I tried using a span class but that didn't override it and the links stayed grey as normal. My styles are as follows:
.listingpage table td a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #3082AD;
font-weight: bold;
}
.listingpage table td a:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #3082AD;
font-weight: bold;
}
.bluebold a:link{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
font-size: 11px;
}
.bluebold a:hover{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
font-size: 11px;
}
I am trying to use the style as follows:
<div class="listingpage">
<table>
<tr>
<td>text <a href="#">link</a></td>
<td> More text <span class="bluebold"><a href="#">more</a></span>
<td>text <a href="#">link</a></td>
</td>
</table>
</div>
I know it has something to do with the nesting of the styles and the fact that the listingpage style is more specific but I am not sure how I can override it. I have a generic link style as well which is slightly different again so I don't just want to move the grey link into the main style. Any help is most appreciated.
.listingpage table td a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #3082AD;
font-weight: bold;
}
.listingpage table td a:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #3082AD;
font-weight: bold;
}
.bluebold a:link{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
font-size: 11px;
}
.bluebold a:hover{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #333333;
font-size: 11px;
}
I am trying to use the style as follows:
<div class="listingpage">
<table>
<tr>
<td>text <a href="#">link</a></td>
<td> More text <span class="bluebold"><a href="#">more</a></span>
<td>text <a href="#">link</a></td>
</td>
</table>
</div>
I know it has something to do with the nesting of the styles and the fact that the listingpage style is more specific but I am not sure how I can override it. I have a generic link style as well which is slightly different again so I don't just want to move the grey link into the main style. Any help is most appreciated.