Advanced Search

Results 1 to 9 of 9

Thread: a:link rule won't work on a link tag

  1. #1
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default a:link rule won't work on a link tag

    How come a:link and a:visited rule isn't applying on <a> tag (www.dischmedia.com/daw/events/kick-off.php) where the link with white text says National Institute Technical for the Deaf just above the street address and name of building? You can also view same problem for each events pop-up window from www.dischmedia.com/daw/calendar.php.

    Other links in the pages are displaying correctly in maroon text color just as I wanted them to be, not white.

    Website: www.dischmedia.com/daw
    CSS: www.dischmedia.com/daw/style.css

  2. #2
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I just figured out that a:link, a:visited rule needed to be added which wasn't there except for a:hover rule.

    Thanks in advance if you have any of your input/tip or feedback.

  3. #3
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    For future preference and for the possible readers of this thread, you should lay off your styles in "link-visited-hover-active" order.
    LoVeHAte.
    Code:
    a:link
    a:visited
    a:hover
    a:active
    For further reading
    http://meyerweb.com/eric/css/link-specificity.html
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  4. The Following User Says Thank You to rangana For This Useful Post:

    mdisch (08-26-2008)

  5. #4
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    a:hover rule still doesn't work the way I wanted it to turn into white text color with maroon background color while cursor hovers over the link.

    The problem occurs only for visited links. Help?!

  6. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You set it explicitly:
    Code:
    .calendar a:link, a:visited {
    	color: maroon;
    	text-decoration: none;
    }
    
    .calendar a:hover {
    	text-decoration: underline;
    	background-color: #CCFFFF;
    	cursor: pointer;
    	color: maroon;
    }
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  7. #6
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I apologize for not making myself clear. I was referring to www.dischmedia.com/daw/events/kick-off.php after you click one of the events from the calendar. In the page where text says 'National Technical Institute for the Deaf' with link. It turned into maroon text color with same color background when hovering over the link. The problem only occurs when the link has been visited. I wanted it to be into white text same as for a:link rule which I set under general styles rules, a:link, a:visited, a:hover.

    CSS: www.dischmedia.com/daw/style.css

    Code:
    /* general styles */
    a:link {
    	color: maroon;
    	text-decoration: none;
    }
    
    a:visited {
    	color: maroon;
    	text-decoration: none;
    }
    
    a:hover {
    	cursor: pointer;
    	background-color: maroon;
    	color: white;
    }

  8. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    As I said, you stated the rule:
    Code:
    .calendar a:link, a:visited {
    	color: maroon;
    	text-decoration: none;
    }
    You include a:visited there (style.css). Try to remove it, or better have a different rule where the color property is not maroon.

    Hope that makes sense.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  9. #8
    Join Date
    Jan 2008
    Posts
    4,103
    Thanks
    18
    Thanked 615 Times in 611 Posts
    Blog Entries
    5

    Default

    Code:
    .calendar a:link, a:visited {
    	color: maroon;
    	text-decoration: none;
    }
    Should be.
    Code:
    .calendar a:link, .calendar a:visited {
    	color: maroon;
    	text-decoration: none;
    }

  10. The Following User Says Thank You to Nile For This Useful Post:

    mdisch (08-27-2008)

  11. #9
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks, Nile that's what I'm looking for.

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
  •