I am trying to format every link (and text) within a specific table to be white. The default link color is the same color as this specific table I am working with. The defaults can't change. I know I can assign every link individually by doing the following:
<style type="text/css" media="screen"> <!-- a.white:link { color: white; } a.white:active { color: white; } a.white:visited {color: white; } a.white:hover { color: white; } --> </style> <a href="#" class="white">text</a>
But my content is dynamic and I can't apply the white class individually. I need to apply it to EVERY link in a certain table. Here's a sample page of what I'm dealing with:
<html> <head> <title>link formatting</title> <style type="text/css" media="screen"> <!-- a.white:link { color: white; } a.white:active { color: white; } a.white:visited {color: white; } a.white:hover { color: white; } .white { color: white; font-size: 10px; font-family: Verdana; } --> </style> </head> <body bgcolor="white" text="black" link="maroon" vlink="maroon" alink="maroon"> <table width="100" border="0" cellspacing="0" cellpadding="10" bgcolor="maroon"> <tr> <td class="white"> text<br> <a href="#">link</a> </td> </tr> </table> </body> </html>
It's not working. What am I doing wrong? Is there another way to make every link and text in a specific table a specific color without touching the default colors?
Specific link formatting...
what i know about links inside global text style, is that you do it the opposite way...
the way you do it:
a.white:link { color: white; }
this force you to attach a style in your <a tag... (means you tell that the <a tag with the white class will be white!)
the way it work for me is this:
.white a:link , .white a:visited , .white a:active { color: white; }
... that way, everything that have the white style will apply the color in it, without having to specific that is inside <a tags, because the way it is written right now force the <a tag to have that style...
... you can specify a different style for hover(it's more than active), but have to be specified after the others or it will not work. (usual css stuff)