PDA

View Full Version : Simple Onclick, Not Clicked question



serendipity
08-21-2005, 08:01 PM
:rolleyes: Gee,this is a bit embarrassing...i know its kinda simple but i cant seem to figure out why...

Here's my pathetic CSS script:

<style>
a:link
{
text-decoration:none
}
a:visited
{
color: #000000;
}
a:hover
{
color: #FFFF00;text-decoration:underline
}

a:active
{
color: #006666;text-decoration:underline
}
</style>


My problem is everytime I click on a link on the page, the underline remains...i've tried dozens of combinations but everytime I click and even reload the page...the darn underline still remains...ugh... :confused:

The other "issue" I have is how do you make the link "remain in an onclick" mode, (thus telling the visitor that it was the current link clicked)...however, as soon as another link is clicked...the last one clicked changes back to its original mode...ugh! I should get my _ss clicked! :eek:

Thanks for any replies

mwinter
08-21-2005, 08:58 PM
<style>The type attribute is required:
<style type="text/css">


a:visited
{
color: #000000;
}Whenever you specify a foreground colour, you should always make sure that a background colour is explicitly specified for that element somewhere. Users with a default colour scheme that differs from yours (a themed Windows or Linux desktop, or altered browser preferences - either for aesthetic or accessibility reasons) will otherwise find an unreadable document.


My problem is everytime I click on a link on the page, the underline remainsYou don't explicitly remove the underline with the visited pseudo-class (may be a problem, depending on the default browser style sheet), but even then the decoration will only be removed on subsequent visits, and whilst that destination remains in the browser history.


The other "issue" I have is how do you make the link "remain in an onclick" modeThe active pseudo-class (the equivalent of 'onmousedown', usually) only applies whilst the element is active. Once the user stops interacting with the element, it will revert to its previous style. The only way to persist the effect would be using a script. Is it really that important?

Mike

jscheuer1
08-21-2005, 09:58 PM
This might get you closer to what you are looking for:

a:visited
{
color: #000000;
text-decoration:underline;
} Oh, and give it a background color, Mike is so right about that.

serendipity
08-22-2005, 05:00 AM
Thanks for the tip guys! The simple ones usually get me :D


The active pseudo-class (the equivalent of 'onmousedown', usually) only applies whilst the element is active. Once the user stops interacting with the element, it will revert to its previous style. The only way to persist the effect would be using a script. Is it really that important?

Mike

Hmmmm...well, its not really that important, but it is kinda cool "effect" to have, especially since i've kinda discovered the wonders of "iframes" --pages within pages. Actually, the effect i'm looking for is similar to the Link Bar Properties on MS Frontpage...text links/graphics get "highlighted" or decorated when hovered on a menu link, and when clicked, it loads the page but at the same time the "highlight effect" remains active as a sort of "reminder" to where the page user is currently uhm, located. It's pretty neat and simple especially when the menu bar links indicate where you are right? But hey, its just me ;)

jscheuer1
08-22-2005, 06:48 PM
Well, if frontpage can do what you want, why not use it? I have a feeling a script would be involved in the effect though. If the script is not cross browser friendly, it could be made so. Can you supply a link to a page that does what you want yours to do? I'm sure it is possible, probably fairly simple, partly I am not clear on the exact specifics or I'd write you some code myself.

serendipity
08-23-2005, 12:28 PM
Well, if frontpage can do what you want, why not use it? I have a feeling a script would be involved in the effect though. If the script is not cross browser friendly, it could be made so. Can you supply a link to a page that does what you want yours to do? I'm sure it is possible, probably fairly simple, partly I am not clear on the exact specifics or I'd write you some code myself.

:o Good question! Actually, I do use the Frontpage quite often (along with good ole Notepad..in that way i'd like to think pretend I'm "old school" ;) However, there's not much fun breaking down javascripts on FP. Besides, I don't think that particular one I'm looking for runs on javascript anyways...i think its most probably CSS which I have not really grown to love yet (im still old school HTML..haha) so i don't bother much with it...and dont even get my started with th0se cross-browser issues.. :(

Hmmmm...great offer! Thanks! Lemme think about it (my amateurish pathetic attempts to build a website is embarrassing to say the least)......but you obviously have some time in your hands if you're "offering" to write code yourself..im just a big chief of cut and paste! :D