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

cell background color

Status
Not open for further replies.

cill

Technical User
Jan 29, 2002
4
CA
I have posted a test of what I am trying to build at
What I am doing is creating a navigation system with a table.
The problem I am having is when you mouseover a cell I want the whole cell to change color. Right now only the background behind the text changes. I have tried setting the size of the cell in the a:hover but that moves the copy around and various other things.

Any help would be appreciated

Thanks
 
With something like this I would create two images one with you text w/ the black background and a second with the text with the blue background. Then under the common tools in dreamweaver use the insert rollover image button(top right). use the image w/ black as image 1 and the image w/ blue as image 2. Asign your links to this and your off and running.
 
i would suggest using a bit of javascript rather than css for this...

if you give your cells an id and apply a background colour to them, you can apply a rollover effect to the cell like this...

<td id=&quot;myCell&quot; bgcolor=&quot;blue&quot; onMouseOver=&quot;this.style.background='red';&quot; onMouseOut=&quot;this.style.background='blue';&quot;>blah</td>

...or, if you have loads of cells, you could write a couple of javascript functions to do this and pass colours into them...

function change(colour)
{
this.style.background = colour;
}

function changeBack(colour)
{
this.style.background = colour;
}

...and your cells would look something like...

<td id=&quot;myCell&quot; onMouseOver=&quot;change('red');&quot; onMouseOver=&quot;change('blue');&quot;>blah</td>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top