SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking CSS and links help needed!

    CSS and links???
    i have set my styles for links to be green when in normal, active and visited states and only to change when hovered. it works fine, but when i click on a link and then go back to the page with that link, the rollover action does not work unless i click my mouse on the page or refresh. how do i get the rollover state to work at all times even after the link is clicked and revisited?

    the example is here;
    http://www.keenerassociates.com/DRAFT/home.html

  2. #2
    SitePoint Guru moonman's Avatar
    Join Date
    Dec 2000
    Location
    The Sea of Tranquility
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've had a quick look at the css, and I can't see any problem with the code. Sorry

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you post the portion of your CSS code where you defined the styles for your links?

  4. #4
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sure thing.....

    here's the code taken from my stylesheet:


    .bodylink { font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; font-weight: bold; text-decoration: none; font-size: x-small}
    a.bodylink:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
    a.bodylink:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
    a.bodylink:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: underline }
    a.bodylink:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: none }

  5. #5
    SitePoint Member
    Join Date
    May 2002
    Location
    Canada!
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try moving all of the a.bodylink:hover {...} portion below the a.bodylink:active {...} portion.

    for some reason, css wont read the link stuff after hover haas been defined. or at least not in my travels


    thanks,
    chillin

  6. #6
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OOPS!! WRONG ONE!!

    i'd actually made changes since i posted that. this is actually the correct one that corresponds to the problem and the url I posted.

    .bodylink { font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; font-weight: bold; text-decoration: none; font-size: x-small}
    a.bodylink:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
    a.bodylink:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
    a.bodylink:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: underline }
    a.bodylink:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }

  7. #7
    SitePoint Member
    Join Date
    May 2002
    Location
    Canada!
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    same thing still applies.

  8. #8
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaah haaaa......bingo!

    how did you ever figure that one out? trial and error, i assume. would have never thought that would be it!

    thanks you are a life saver!!

    (p.s. do you know anything about dreamweaver and the show/hide layers option??)

  9. #9
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a little rule of fist you could use.

    At first a link is a link, it is not active or whatever. When clicked, the link becomes active immediately, and after that it is visited.
    The hover attribute is a little extra, which should overrule all classes, so therefore it is mentioned last.

    I always used that when I started out with CSS, now it has become habit to place them in the right order.

  10. #10
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    funny, someone on another forum told me to keep them in this order

    link
    visited
    hover
    active

    but that's how they were originally and it didnt work until i switched hover and active.

    it's good to know that these things make such a difference!

  11. #11
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please try the following syntax:

    bodylink a:link
    bodylink a:visited
    bodylink a:hover
    bodylink a:active

    L V H A is the correct order.

    I was lecturing on this very topic the other day.

    Please let me know if it works!!!!

    Nancy

  12. #12
    SitePoint Member
    Join Date
    May 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    you say tomato they say tomato some say tomorrow!

    LVHA is what i originally had but it didnt work.

    someone suggested LVAH which was the only syntax that did actually work.

    i never would have thought this would make a difference!



  13. #13
    SitePoint Member
    Join Date
    May 2002
    Location
    Canada!
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    glad to hear it works!

    i found out by spending a good hour or so on it...
    what a pain it was.

    good luck.

  14. #14
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that's a funny little quirk indeed. I have learned something new today. Seems that I've not had this error occur in my pages, but it could easily have happened - if it does, I'll know why now!
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback


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
  •