[thelist] Changing Link Colors In Site

Djinn djinn at darkdesigns.org
Sat Oct 19 23:27:02 CDT 2002

This is exactly the kind of thing I'm looking for. But can you tell me how
to write the styles inline? I won't be having a separate style sheet for
now. Thanks.

Jean Peterson

At 08:26 PM 10/16/02 -0600, you wrote:
>JP> "If I have a table layout with 3 columns and want my link colors to
>be a certain color in one column and a different color in the other two,
>how and where do I specify them?"
>The easiest way to do this is to use class attributes and contextual
>selectors. What I mean is that you can assign classes to each of your
>columns like this:
><td class="col1">foo</td>
><td class="col2">bar</td>
><td class="col3">baz</td>
>And then specify that anchor elements in td elements with certain
>classes have certain colors by adding something like this to your
>td.col1 a {
>      color: rgb(255, 128, 128);
>td.col2 a {
>      color: Red;
>Etc. Of course, this is just a basic example and doesn't touch on using
>pseudo-classes like a:link and a:active, but the principle stays the
>same. You can omit the "td" part of the rule if you're not going to be
>using those class names on any other elements.
>This isn't the most effective way to do it - there are selectors for the
>first child element and so on which would make it unnecessary to use the
>class selectors - but they're not widely supported yet.
>S. G. Kearn
>For unsubscribe and other options, including
>the Tip Harvester and archive of thelist go to:
>http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list