[Wylug-help] Style problem.

Smylers Smylers at stripey.com
Thu Mar 1 11:45:26 GMT 2007


Gary Stainburn writes:

> The code below does exactly what I want it to do. It displays a green
> box and a brown box, both with white writing in.  However, when I try
> to do this on the page I need it for, I always black writing. Does
> anyone have any clues why?

Yes.  Because on the live page after:

> td#day54 { color: #ffffff; background-color: #876811;}
> td#day55 { color: #ffffff; background-color: #72bf44;}
> <snip>

You then have:

  #rostertable a
  {
    display: block;
    text-decoration: none;
    color: #000;
  }     

The text in your table cells is all links, so both rules match.  Note
that both that rule and the td#day54 ones match one ID and one element
name, so they have the same specificity -- which means the latter rule
is applied and the links turn black.

If you change that to:

  color: #FFF

then all links in the table will be white (and you can remove the text
colour from each separate cell).

If you want the link (text) colour to depend on the background colour
then make the link text be:

  color: inherit;

and it will use whatever is specified as the text colour for the cell as
a whole.

Smylers



More information about the Wylug-help mailing list