help in out in css

Discussion in 'CSS' started by webdesignerindia, Aug 3, 2007.

  1. #1
    Can anyone tell me how to active an anchor using css

    i want to know how to make the link active with different color or something as you like to say !!!



    regards,
     
    webdesignerindia, Aug 3, 2007 IP
  2. Jezek

    Jezek Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  3. webdesignerindia

    webdesignerindia Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Jezek,

    But it jumps to another page and it shows color difference when we clicks, but what i m looking is,

    Suppose we have three links

    first link | second link | third link

    Now if somebody click on the first link other two link should show the blue color and first link should be different

    and now if somebody again click on the second link so the first one n the last one should have the blue and the second link should have different color


    I hope now it more clear my question

    regards,
     
    webdesignerindia, Aug 3, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You mean the various link states?

    
    a:link {
        background: transparent;
        color: #00F;
    }
    
    a:visited {
        background: transparent;
        color: #0FF;
    }
    
    
    a:hover {
        background: transparent;
        color: #F00;
    }
    
    a:active {
        background: transparent;
        color: #F00;
    }
    
    Code (markup):
     
    Dan Schulz, Aug 3, 2007 IP
  5. webdesignerindia

    webdesignerindia Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Dear Dan,

    In this css script we know when any link visited will show the visited color in css and on hover will be different. I think you didn't read the second question related to this I asked....




    regards,
     
    webdesignerindia, Aug 3, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You're right, I didn't see that. You can't do what you want with CSS, since you're talking about manipulating the behavior of the Web page. JavaScript however...

    I suggest you send a PM to deathshadow asking for his input on this (tell him I recommended you). With over 20 years of programming experience under his belt (and I don't mean just for the Web, but actual computer programming as well), he's the most qualified person on this forum who can answer your question on behavior.
     
    Dan Schulz, Aug 3, 2007 IP
  7. webdesignerindia

    webdesignerindia Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    dear dan,

    Thanks for your advice...as I heard it is possible by css...now the problem is

    from where I can search out deathshadow and where should I PM him, coz i m not familiar with forums !!!



    regards,
     
    webdesignerindia, Aug 3, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Dan Schulz, Aug 3, 2007 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #9
    You rang?

    I'm not ENTIRELY certain I follow what's being asked - it sounds like you are asking about :visited - but I'm not sure.

    With your links, are you referring to having copies of each on every page like a menu, with each lighting up depending on which page you are on? If so, you need to tack a class in the menu item - I usually use 'current'.

    otherwise, it sounds like you are asking about :visited, except you want it to turn off (which doesn't work) - most people are confused by your using the word active, since that is a psuedoclass used for keyboard navigation - yet that is definately NOT what you are asking for.

    But again, I'm having a dog of a time making sense of the question.
     
    deathshadow, Aug 5, 2007 IP
  10. webdesignerindia

    webdesignerindia Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hi deathshadow,

    I didn't remember where I read about the a:focus method to show the active link.

    see visited link is what when the user already pass on that link but I m looking for if the guy is on a page we use to show by images for differentiate but I want to show the link is focus n that page's link is active.

    I hope you got my point.

    Best regards,
     
    webdesignerindia, Aug 5, 2007 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #11
    Could you repeat that in english, or could anyone else translate for me? I still can't figure out if he's asking for :visited, :focus or adding a class to each page to indicate the current one.
     
    deathshadow, Aug 5, 2007 IP