Forum Moderators: not2easy

Message Too Old, No Replies

a.class problem ~ very, very weird

         

kf638197

7:54 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



I'm experiencing a very weird problem & need some help. In trying to apply a class to my "a" tag, the class only renders itself on some "a hrefs", not all (on the same page). For example, I have 3 "a href" tags, all with the same class. Only two of the three will display. The other remains white, until it's hovered over and then it appears according to my style applied under "a.list:hover". If I change the class to another one in my css sheet, it appears. And here's a weird thing: if I change the URL in the "a href" tag to another page on my site, it shows up. If I change it back to my intended URL, it disappears again. The problem is in IE7. Works fine in Opera. Below is a snippet of my code:

a.list {font-family:arial;
font-size:10px;
text-decoration:none;
color:#7579D7;
}
a.list:hover {font-family:arial;
font-size:10px;
text-decoration:none;
color:#5C62F4;
}

Doc type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Has anyone ever experienced this? It's maddening. Thanks in advance!

Kelly

londrum

8:40 pm on Jun 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



could be one of two things:

1) to me, it sounds like you haven't set the styles for :visited.
if a link hasn't been visited at all, then it will takes the styles from a, or a:link
if it has been visited, then it will take the styles from a:visited.
that is why the link colour is changing when you change the url to something else - it is probably an unvisited or visited page (...the opposite of what it originally was).

2) you might have styled the links in the wrong order in your CSS. if you do them in the wrong order then you will get wierd effects depending which browser you are using. the correct order is like this

a:link
a:visited
a:hover
a:active

kf638197

9:17 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



Londrum...omg, thank you. I didn't set the style for a:visited. Major duh moment. MUCH appreciated. :-)

Xapti

5:58 am on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Off-topic... I'd highly recommend you do not use a 10px font... if it's going to be small, at least make it with pts or ems.