...

View Full Version : Links



Demon
12-17-2006, 12:19 PM
Hi,

This has been a big problem for me in the past and now again.

The problem is with the visited links. I want my links to act the same as most portals. By default it turns purple and underlined, I don't want that. I used to use Wordpress for a blog and when you clicked on a link, the link would remain "unvisited" and still use the a:link.

I find these things hard to explain, sorry.

Thanks.

whizard
12-17-2006, 12:23 PM
add this CSS code to your document or your stylesheet (don't know if you have a stylesheet with wordpress)

CSS


a:visited
{
color:#COLOR YOU WANT;
}


Dan

Demon
12-17-2006, 12:27 PM
Thanks for the reply, but that's not quite what I want.

I don't want the visited parameter in there at all, I don't want the visited parameter to exist on my pages.

whizard
12-17-2006, 12:33 PM
What's wrong with the visited parameter?

You could give it exactly the same definitions as the a:link, and no one would no the difference

Dan

Demon
12-17-2006, 12:43 PM
Okay, thank you. I just done a little test experimenting and I've learnt that it matters what order you put the parameters, hehe.

This is what I have now:


a:link {
color: #004784
text-decoration: underline;
}

a:visited {
color: #004784;
text-decoration: underline;
}

a:hover {
text-decoration: none;
}

It works great, thank you. :)

whizard
12-17-2006, 12:46 PM
No problem. Sorry I didn't mention about the order, it didn't occur to me to do so. Just as a note, if you ever use a:active, it must go after hover.

Dan

Arbitrator
12-17-2006, 02:29 PM
a:link {
color: #004784
text-decoration: underline;
}

a:visited {
color: #004784;
text-decoration: underline;
}

a:hover {
text-decoration: none;
}Since the unvisited and visited states are going to be identical, you can reduce the amount of code required by combining the two rule sets. Example:


a:link, a:visited {
color: #004784;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}

Or, you could reduce things even further by targeting only the anchor element and not a specific pseudo‐class (:link and :visited are pseudo‐classes). Doing so should override the browser’s default styles for ALL states, effectively setting them for both :link and :visited. Thus:


a {
color: #004784;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}

In the above example, using the simple selector a sets styles for the :link, :visited, :hover, :focus, and :active states simultaneously. The rule set following it, overrides the text-decoration style for the :hover state (implicitly) set by the previous rule set.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum