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 8 of 8
  1. #1
    Junior Member
    Join Date
    Jul 2005
    Location
    Haifa
    Posts
    22
    Member #
    10582
    On http://lyricslist.com I have a list of links that I want to change their color. At the top of the table that they are in (The table of letters under the header, near the google links.) I declared a class, and in the head I put this code:
    a.lettersMenu:link,a.lettersMenu:active,a.lettersM enu:visited,a.lettersMenu:hover { text-decoration: none; color : #BDBDE5; font-size: large; }

    However, the letters are not affected! I even tried adding the class declaration to every individual TD but that did not work either. According to all I've read, this is correct. Why won't it work?

    Thanks.

    Dotan Cohen

  2.  

  3. #2
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    "a.lettersM enu" has a space, which throws off the whole css definition. It is looking for an element called "enu:visited,a.lettersMenu:hover" which obviously doesn't exist.

  4. #3
    Junior Member
    Join Date
    Jul 2005
    Location
    Haifa
    Posts
    22
    Member #
    10582
    I don't know in what program you looked at the source code, but between all the other problems, I was unaware of a space lurking in there.

    It turns out that I had the elements in the wrong order (link, visited, hover, active). I didn't know that they had a particular order.

  5. #4
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    I was going by the code you posted in the first post. Glad you got it figured out though.

  6. #5
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    yes I have just repoduced this, and the order has to comply...

    wasn't what I was expecting either...

    -Hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  7. #6
    Junior Member
    Join Date
    Jul 2005
    Location
    Haifa
    Posts
    22
    Member #
    10582
    I just came across a nice way to remember the order for the elements: LoVe HAte. (link, visited, hover, active).

    Just thought that I'd let everybody know, to help others out of this mess.

    Dotan
    http://lyricslist.com/lyrics/biograp.../sepultura.php
    Sepultura Song Lyrics and Biography

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Note that this is due to the way CSS2.1 and cascading of style rules works.

    Basically, a:link and a:visited apply to *all* states; as such, if you specify a:visited after a:hover and a:active, any visited links will have that pseudoclass applied and it will override any a:hover and a:active settings you gave it. a:link has the same property: specifying a:hover and a:active before an a:link should result in neither of those working when the link is unvisited.

    a:link and a:visited are mutually exclusive, so the order amongst those two shouldn't matter. The same should apply to a:hover and a:active. So link, visited, hover, active should give the same effect as visited, link, active, hover; however, link, hover, active, visited should result in visited links not having different hover/active colors, and visited, hover, active, link should result in unvisited links not having different hover/active colors.

    Note that I used `should' a lot. I didn't sit down to test this; however, according to the CSS spec, this is how these properties should theoretically work.

  9. #8
    Junior Member
    Join Date
    Jul 2005
    Location
    Haifa
    Posts
    22
    Member #
    10582
    Excellent. I knew that there had to be an explanation for that behaviour- there always is. Many times explanations of the heiarchy explain the 'unusual' behaviour of browsers. Thanks for passing that on.

    Dotan Cohen
    http://technology-sleuth.com/short_a...t_is_hdtv.html


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 06:00 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com