link types

He has: 688 posts

Joined: Feb 2001

Simply put: Other than the "link types" link, active, and visited, what else is there?

Now here are the specifics: I've just barely gotten started with this new site. I'm currently just working out the template and directory structure and not actual content, but I noticed a situation with my links, which are all controlled by css. This is the page to check and you'll see a list of standard links. They appear with no underline until you hover over them (my choice). That's all fine and dandy but when you click a few links and go back to that page, the links that you've already visited won't give you the underline decoration on hover over anymore. I'm using IE. What css property am I missing regarding link types?

Confused

Here's a wierd twist. The navigation links at the top are different (separate link class) but they work in a similar 'no underline until hovered' fashion. Yet they don't seem to have this problem, even though the css for those links use the same three "link types" mentioned before. Huh?

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

The link you are using does not work for me.

As for the other psudo classes there are four: Hover, Active, Visited and Link

This page might be of soem help to you:
http://www.w3schools.com/css/css_pseudo_classes.asp

Busy's picture

He has: 6,151 posts

Joined: May 2001

think of love hate when it comes to links

link o visited e
hover active t e

He has: 688 posts

Joined: Feb 2001

I don't know what to say about the link. It works for me. Maybe it was just a temporary thing? Incase it still doesn't work for some reason, the page is hampton-homes.net/homes/ (Does the trailing "/" mess things up in some browsers?)

As for the pseudo classes, I guess I do have all four you mentioned. I mentioned three because I thought of hover as a separate state in my sitiation. Here's the section of css I'm using. The first two are standard/general (the one I'm having trouble with) and the next two are just to show that the top navigation links that aren't having this problem are set up exactly the same way:

<?php
a
:hover {color: #0000ff;
   
font-style: normal;
   
font-weight: normal;
   
text-decoration: underline;
   
font-size: 16px;}

a:link, a:active, a:visited {color: #0000ff;
   
font-style: normal;
   
font-weight: normal;
   
text-decoration: none;
   
font-size: 16px;}

a:link.header, a:active.header, a:visited.header {color: #ffcc00;
   
font-style: normal;
   
font-weight: bold;
   
text-decoration: none;
   
font-size: 11px;
   
font-family: arial,sans-serif;}

a:hover.header {color: #ffcc00;
   
font-style: normal;
   
font-weight: bold;
   
text-decoration: underline;
   
font-size: 11px;
   
font-family: arial,sans-serif;}
?>

taff's picture

They have: 956 posts

Joined: Jun 2001

Quote: Originally posted by fifeclub
Here's a wierd twist. The navigation links at the top are different (separate link class) but they work in a similar 'no underline until hovered' fashion. Yet they don't seem to have this problem, even though the css for those links use the same three "link types" mentioned before. Huh?

That is weird but I think I may know why. Looking at your stylesheet, the order of your elements is reversed for the two link classes. Order *does* count although I'm no expert on the proper way to do this.

Try putting "a:hover" after "a:link, a:active, a:visited" - I'm pretty sure this will clear things up.

Edit: heh - refreshing the page first would have saved me a lot of investigation Sticking out tongue

.....

He has: 688 posts

Joined: Feb 2001

Laughing out loud That was it, that fixed it. Thanks Taff. I wasn't aware that order mattered in css.

(I love the simple fixes that take only 10 seconds to fix)

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

FWIW, the order within element part should be:

element.class:pseudoclass
element#id:pseudoclass

element is optional.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Quote: Originally posted by Suzanne
FWIW, the order within element part should be:

element.class:pseudoclass
element#id:pseudoclass

element is optional.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

heh, yeah, that. *doh*

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.