Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    WTF wont this work right? Is this a planned feature in CSS or just a lame thing that eveyrone agreed on? In case you don't know what I'm talking about, I'm referring to visited links. Say you have something like this:

    Code:
    a:link{
    text-decoration:underline;
    }
    a:hover{
    text-decoration:none;
    }
    a:visited{
    text-decoration:none;
    }
    the visited links will always be underlined and not go to the hover state ever again... UNLESS you do something with the background color like I've done with the nav for www.towerframing.com in the nav. You'll see that even visited links still have the mouseover effect. To me, this is the biggest flaw I've found in CSS... granted you can do the desired effect with javascript... but that's 5x more code than should be neccesary.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  2.  

  3. #2
    Senior Member mossoi's Avatar
    Join Date
    Apr 2003
    Location
    Englandshire, United Kingdomsville y'all!
    Posts
    1,111
    Member #
    1206
    Liked
    1 times
    This should work:

    code:---------------------------------------------------------------------------

    a:link{
    text-decoration:underline;
    }
    a:visited{
    text-decoration:underline;
    }
    a:hover{
    text-decoration:none;
    }
    --------------------------------------------------------------------------------

    I assume what you want is for the link to not be underlined when you hover over it but be underlined in any other state. I think you've made a typo above because you're specifying no underline for the visited link - it seems that you want it to actually be underlined.

    The way later CSS definitions overwrite previous ones on a page is what''s causing this problem. In your code the browser sees a hover definiton which is then overwritten by the visited definition. If you switch the hover and visited around then hover takes precedence and the problem is solved.

    Don't believe them when they say that the order of your stylesheet doesn't matter!

  4. #3
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Yeah it was a typo, however try that code - it wont work for visited. I'll try switching them around and see what's up with that...
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  5. #4
    Senior Member mossoi's Avatar
    Join Date
    Apr 2003
    Location
    Englandshire, United Kingdomsville y'all!
    Posts
    1,111
    Member #
    1206
    Liked
    1 times
    Hmmm, it works for me in IE and Mozilla. I tested it before I posted. You did use the code above? I've switched the hover and visited links as well as correcting the typo.

  6. #5
    Senior Member mossoi's Avatar
    Join Date
    Apr 2003
    Location
    Englandshire, United Kingdomsville y'all!
    Posts
    1,111
    Member #
    1206
    Liked
    1 times
    This is an example of the code in action. I've linked to the BBC hompage, chances are you've not visited that before.

    Example.htm


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:58 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com