[thelist] simple css help

aardvark evolt at roselli.org
Fri Oct 28 11:45:03 CDT 2005


On 28 Oct 2005 at 11:24, Casey wrote:

> Ok this should be an easy one.  I have a <td> in which i want to swap bg 
> colors and font colors on mouseover.  Everything works great until you try 
> to make the text in the td a link.
[...]

you need to not do the onmouseover events to change your styles... 
use CSS to affect the hover state...

put an anchor in the cell, set it to display:block, and then add your 
styles to the .tdback a:hover... assuming you don't put an id on the 
entire table to make it an easier selection...

<table id="LinkThing">
 <tr>
  <td><a href="foo">Bar</a></td>
  <td><a href="bar">Foo</a></td>
 </tr>
</table>

#LinkThing a
	{	display: block;
		text-decoration: none; }

#LinkThing a:hover
	{	background-color: #323E3E;
		color: #BEB778; }

add padding, margin, colors, borders, etc., to your heart's 
content...




More information about the thelist mailing list