Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: CSS link reset

  1. #1
    New Coder
    Join Date
    Jul 2008
    Location
    Omaha
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question CSS link reset

    Hello,

    I'd like to know how do I "reset" the links (colors) to the original setting every time a page is called.

    So, as an example these are the initial conditions.

    a:link {color: #0000C0;text-decoration: none;}
    a:visited {color: #FF0000;}
    a:hover { color:#FFFF3A; text-decoration : underline;}
    a:active{color=#00C0C0;text-decoration : underline; }

    Since a link has been visited it turns red.

    Question is how do I reset the red link(s) o back to the initial conditions(#0000C0) ?

    Thanks for any help

  • #2
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts
    That cannot be done with HTML. You need a server side language that will log page calls and change the page details as the page is fetched.

  • #3
    New Coder
    Join Date
    Jul 2008
    Posts
    99
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Question is how do I reset the red link(s) o back to the initial conditions(#0000C0) ?
    what if you simply do?

    Code:
    a:visited {color: #0000C0;}

  • #4
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts


    That cannot be done with HTML.
    well thats correct but,

    You need a server side language that will log page calls and change the page details as the page is fetched.
    hmm, css isn't server side.

    just make the 'visited' status show the color you want.
    Code:
    a:visited {
    color:#0000C0;
    }
    Edit: oops, I didn't see ramm19's post

    bazz
    Last edited by bazz; 07-16-2008 at 02:46 AM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    [QUOTE=bazz;712251]

    [quote=macwiz;712156]That cannot be done with HTML.
    well thats correct but,



    hmm, css isn't server side.

    just make the 'visited' status show the color you want.
    Code:
    a:visited {
    color:#0000C0;
    }
    bazz
    Bazz didn't you see the reply above yours? It was already answered.
    No harm in telling macwiz s/he was wrong though I suppose.

  • #6
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I must have been adding the edit message when you posted because I realised it had been answered as soon as I saw mine posted.

    Still, I have now edited it again, to fix the quotes tags.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #7
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts
    I know that CSS isn't server side.

    I am saying the you would need a Server Side Language to do it.

    However, you may be able to do it with JavaScript and a cookie.

  • #8
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    but surely it just needs the one line of css. I don't think the OP is trying to reset computer/browser defaults: just the colour of the links in his/her own page

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #9
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts
    I'm just putting it out there as an option...

  • #10
    New Coder
    Join Date
    Jul 2008
    Location
    Omaha
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by macwiz View Post
    That cannot be done with HTML. You need a server side language that will log page calls and change the page details as the page is fetched.

    Thanks for the reply but
    1. I just don't understand why di I need a server side language to reset the color.
    2. I think there is a way to to do it though CSS but I don't no how.

  • #11
    New Coder
    Join Date
    Jul 2008
    Location
    Omaha
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply.

    Problem is where should the a:visited{color:color:#0000C0;} be placed in the csstyle.css.

    If I place it AFTER the one with #FF0000 the I get always a blue link and then I'm unable to tell which ones I've already visited (or anyone for that matter).

  • #12
    New Coder
    Join Date
    Jul 2008
    Location
    Omaha
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by bazz View Post
    but surely it just needs the one line of CSS. I don't think the OP is trying to reset computer/browser defaults: just the colour of the links in his/her own page

    bazz
    Yes, bazz. You're right. I just want to reset the color of the visited links in the page back to blue and not system wide (browser colors).

  • #13
    New Coder
    Join Date
    Jun 2008
    Posts
    67
    Thanks
    3
    Thanked 13 Times in 13 Posts
    LoVe HAte

    LINK VISITED HOVER ACTIVE

  • #14
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I'm confused, do you want visited links to be blue or visited links to be unvisited because you've been silly and started clicking them locally?

  • #15
    New Coder
    Join Date
    Jul 2008
    Posts
    99
    Thanks
    0
    Thanked 4 Times in 4 Posts
    cssdumb, what you are asking is not possible with CSS alone, and it's not needed, your visitors won't really care if they see a different color or not for visited items until the refresh... simple use the same color for visited as for link and active. We all do it that way


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •