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.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    keeping the color white although it is clicked

    Code:
    <style>
    a:link {text-decoration:none; font-size:13px; font-weight:100; color:9595ff}
    a:visited {text-decoration:none; font-size:13px; font-weight:100; color:black}
    a:hover {text-decoration:underline; color:ff0000}
    
    a.blue_box{  
    display:inline-block;
    background-color:00ccff;
    border: 1px solid 000000;
    color:white;
    }
    </style>
    
    <a href='test.html' class='blue_box'>test</a>
    I designated the color of test in the blue box link white.
    But after I once click the link, it becomes black.

    How can I keep it white without changing of visited color "black" although it is clicked?
    Get my greedy up

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    878
    Thanks
    0
    Thanked 114 Times in 113 Posts
    add this somewhere below a:visited:

    a.blue_box:visited{color:white}

    the reason it changing to black is that the only :visited the sheet have says that all visited anchors should be black

  • #3
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    As a start off, use the hex for colours on all colour specifications - like #000 is black.

  • #4
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    try:

    Code:
    a.blue_box:visited{  
    display:inline-block;
    background-color:00ccff;
    border: 1px solid 000000;
    color:#000;
    }
    Code:
    a:visited:.blue_box{  
    display:inline-block;
    background-color:00ccff;
    border: 1px solid 000000;
    color:#000;
    }
    one should work but can't rember the order of them.

    Edit: he he change my #000 to #fff

    [edit to the edit]man I'm off tonight[/edit]
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #5
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    878
    Thanks
    0
    Thanked 114 Times in 113 Posts
    it doesn't matter cause css support all the color names


    and when specifying you must always order it:
    tag.nameOfTag:state
    Last edited by Lerura; 08-14-2005 at 12:55 AM.

  • #6
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by lerura
    it doesn't matter cause css support all the color names
    yes, but I prefer using the hex as it's more widely used I find.


  •  

    Posting Permissions

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