SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a: link same as a:hover

    Hi there.

    The link is www.sincro.co.za

    Now, what I want to have is this ... (I have seen something like this on page 107 of "The CSS Anthalogy".)

    In the left column of the site above, there is a link to Agrowatt. You will notice the graphic as background with mouse-over. What I want, is that after you have clicked on this link and taken to the Agrowatt page, that specific link must have the same effect as with a mouse-over.

    You will notice that with the menu it works like that. When going to a page from the menu, the specific page's link is bold on the menu.

    I trust my question is clear enough. (Because I am relatively new to CSS, I sometimes know what I want to do, but don't have a clue what it is called in CSS-language.)

    Regards,

    Deon

  2. #2
    Non-Member daedalux's Avatar
    Join Date
    Jan 2006
    Location
    Charlotte, NC
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add a:visited to the link style, and give it the same styling attributes used for a:hover.

    That should do the trick!

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As you have suggested, it did the trick.

    Thanx a lot.

    What does a: focus do exactly?

    Deon

  4. #4
    Non-Member daedalux's Avatar
    Join Date
    Jan 2006
    Location
    Charlotte, NC
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As I understand it, a:focus styles an element which is being highlighted via the keyboard (like hitting the tab button to jump from different areas of the page). I think I read somewhere once that it styles highlighted form input fields as well..... don't quote me on any of this, though

  5. #5
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by daedalux
    I think I read somewhere once that it styles highlighted form input fields as well.
    Yep, it does.

  6. #6
    SitePoint Zealot
    Join Date
    Jan 2006
    Location
    Essex, UK
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by daedalux
    As I understand it, a:focus styles an element which is being highlighted via the keyboard (like hitting the tab button to jump from different areas of the page). I think I read somewhere once that it styles highlighted form input fields as well..... don't quote me on any of this, though
    a:focus is also used when a link has a tab key setting (eg alt g).

    a:focus generally is made to stand out a lot, as a user not using a mouse may not see the link at first.

    As for forms, yes, when you click in a text box or submit button etc the form will be in focus and that object.

  7. #7
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx again for the help to change the a: visited code.

    But, and I know I'm pushing, this is still not what I need. When going to another page where that link is also visible, I want the hover & visited effect to be gone. It must only show while I am on that page. When I browse to another page, the effect must be the normal a: link one.

    Trust you can advice?

    Regards,
    Deon

  8. #8
    Non-Member daedalux's Avatar
    Join Date
    Jan 2006
    Location
    Charlotte, NC
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DeonH
    Thanx again for the help to change the a: visited code.

    But, and I know I'm pushing, this is still not what I need. When going to another page where that link is also visible, I want the hover & visited effect to be gone. It must only show while I am on that page. When I browse to another page, the effect must be the normal a: link one.

    Trust you can advice?

    Regards,
    Deon
    Sure... you'll need to make sure the link code is separately placed on on the homepage and the other pages. For the homepage link, give it its own class that has the hover + visited mouseover effect you want.

    On all the other pages, use a different class for the same link (or none at all, whichever you want). Easy as that!


Bookmarks

Posting Permissions

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