Click to See Complete Forum and Search --> : Text color in cells


glenvern
01-18-2010, 04:23 AM
Default text color is Black:
I have a page of <td's> (several hundred) where I would like the text color to be white.
I have to do this color change in every cell using <span class="> etc...

Can I using CSS or Java make the text in these cells a default white instead of black,
this would save me a lot of codeing.

thanx...

scouse
01-18-2010, 05:33 AM
If I'm understanding you properly? you could just put the following code in your css file to change all the text in your td's to white



td{
color: #fff
}



Is that what you needed?

glenvern
01-18-2010, 09:14 AM
Thanx for that, I imagine that would work ok except I forgot to mention
the text is also in a link, this must make a difference as it didn't work.

<td bgcolor=black> <a href" "> white text </a></td>

scouse
01-18-2010, 09:22 AM
Well in that case you can just do:



td a:link{
color: #fff
}



There are also other states of the link that you might want to set in the same way (e.g, a:link, a:visited, a:hover, a:active)

glenvern
01-18-2010, 09:30 AM
Thank you so much works a treat. wow! what a timesaver cheers...

glenvern
01-18-2010, 09:44 AM
Ran before I could walk - only some of the link texts went white some stayed black can you take a look at the page please and see if you can come up with a reason..

http://www.lewis-james-parker.co.uk/links.html

any help would be appreciated.. Sorted thanx...

scouse
01-18-2010, 09:44 AM
No probs, glad to help :)

glenvern
01-18-2010, 09:54 AM
OK all good now I found my error the links that didn't change were 'visited links' after adding the a:visited all came good.. thanx...

scouse
01-18-2010, 10:56 AM
Hey, sorry I didn't see you're other post, we must have posted at the same time! :)

Glad you got it sorted!