CSS, Links and Hovers

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Toneboy
Forum Contributor
Posts: 102
Joined: Wed Jul 31, 2002 5:59 am
Location: Law, Scotland.
Contact:

CSS, Links and Hovers

Post by Toneboy »

Can't seem to get this right. When showing a link in the "Feedhead" class (so called because it is a header for a feed, before anyone asks) it won't display the link in white, just red (as set earlier).

I have tried searching about for an answer on this, but I think it falls into the category of "What do you put in to look for that?" :) So I thought I'd see if a kind expert could help. Here's the code:

Code: Select all

<style type="text/css">
<!-- 
P &#123; font: 12pt times new roman, serif;&#125;
H3 &#123; font: bold 14pt times new roman, serif;&#125;
H2 &#123; font: bold 18pt times new roman, serif;&#125;
H1 &#123; font: bold 24pt times new roman, serif;&#125;
A:link &#123;color:#FF0000; TEXT-DECORATION: underline&#125;
A:visited &#123;color:#FF0000; TEXT-DECORATION: underline&#125;
A:active &#123; TEXT-DECORATION: underline&#125;
A:hover&#123;color:#a50400; TEXT-DECORATION: underline&#125;
P.menu &#123;font: 10pt Arial, sans-serif;&#125;
P.visitors &#123;font: bold 10pt Arial, sans-serif;&#125;
P.printthispage &#123;font: 9pt Arial, sans-serif;&#125;
P.photo &#123;font: bold 8pt Verdana, Arial, sans-serif;&#125;
li.photo &#123;font: bold 8pt Verdana, Arial, sans-serif;&#125;
P.side &#123;font: bold 14pt Arial, sans-serif;&#125;
td &#123; font: 12pt times new roman, serif;&#125; 
th &#123; font: bold 12pt times new roman, serif;&#125;
td.title &#123;font: bold 18pt Arial, sans-serif;&#125;
li &#123; font: 12pt times new roman, serif;&#125; 

P.feed &#123;font: 8pt Arial, Verdana, sans-serif;&#125;
font.feed &#123;font: 8pt Arial, Verdana, sans-serif;&#125;
font.feedupdate &#123;color:#C0C0C0; font: 8pt Arial, Verdana, sans-serif;&#125;
td.feed &#123;font: 8pt Arial, Verdana, sans-serif;&#125;

td.feedhead &#123;font: bold 10pt Arial, Verdana, sans-serif; color:#FFFFFF&#125;
A.feedhead:link &#123;font: bold 10pt Arial, Verdana, sans-serif; color:#FFFFFF&#125;
A.feedhead:visited &#123;font: bold 10pt Arial, Verdana, sans-serif; color:#FFFFFF&#125;
A.feedhead:active &#123;font: bold 10pt Arial, Verdana, sans-serif; color:#FFFFFF&#125;
A.feedhead:hover &#123;text-decoration: underline; color:#FFFF00&#125;
-->
</style>
As the links are within <td> brackets, does the css need to show something like this?:

Code: Select all

td.A.feedhead:link &#123;etc.&#125;
Thanks in advance.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

I've tested your style sheets with both IE 5.5 and Firebird 0.6.1 on Win2k and on both environments, your feedback class works fine. Links appear white with a yellow hover.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Contextual selector syntax is a space separated list of parents (tags or classes) finishing with the tag to which this style will be applied, when found within the parent tags.

Try this:

td.feedhead a:link {..etc..}
User avatar
Toneboy
Forum Contributor
Posts: 102
Joined: Wed Jul 31, 2002 5:59 am
Location: Law, Scotland.
Contact:

Post by Toneboy »

Excellent - thanks very much McGruff.

(BTW I work in Glasgow - do you work there, or just reside there?)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Work in Glasgow, sort of live there too although that starts to get complicated to explain. My hobbies are getting into fights on trains (two so far this year) and getting knocked down as I cycle about the city (5 times in total).

Ah Glasgow!
User avatar
Toneboy
Forum Contributor
Posts: 102
Joined: Wed Jul 31, 2002 5:59 am
Location: Law, Scotland.
Contact:

Post by Toneboy »

I'm in and out of the city every weekday, on a train to/from Argyle Street. I'm amazed that anyone can find the space to swing a punch on a train which passes through Glasgow! :lol:
Post Reply