Results 1 to 4 of 4

Thread: [RESOLVED] Links css

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [RESOLVED] Links css

    On my page i have a link using the css code below, everything works except once i've clicked on a link the hover no longer works on that link, is there something wrong with the :visited css code. How do i get the hover working when the page has been visited.

    Code:
    a.SmallTextLink:link {
    	font-family: "Franklin Gothic Medium";
    	font-size: 12px;
    	font-style: italic;
    	font-weight: normal;
    	color: #6e6e6e;
    	text-decoration: none;
    }
    a.SmallTextLink:hover {
    	font-family: "Franklin Gothic Medium";
    	font-size: 12px;
    	font-style: italic;
    	font-weight: normal;
    	color: #f67929;
    }
    a.SmallTextLink:visited {
    	font-family: "Franklin Gothic Medium";
    	font-size: 12px;
    	font-style: italic;
    	font-weight: normal;
    	color: #6e6e6e;
    	text-decoration: none;
    	}
    a.SmallTextLink:active {
    	font-family: "Franklin Gothic Medium";
    	font-size: 12px;
    	font-style: italic;
    	font-weight: normal;
    	color: #f67929;
    thanks in advance
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Links css

    flip them around..... when using the sub classes of the a link, use link first, followed by visited, then hover, then active...
    Here's why.... once you visit a link, it takes on the visited styling, but CSS is processed top to bottom, so things at the bottom override styles closer to the top. So when you then hover over a link, because the Visited style is AFTER your Hover, it doesn't appear to change. If you swap them around, so that Hover is after Visited, you'll get the effect you are looking for.

    there's a nmonic I learned "LoVeHAte".... for (L)ink, (V)isited, (H)over, (A)ctive" that helps to keep me in order..... I don't quite get the connection, but it works I guess.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: Links css

    thanks
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: [RESOLVED] Links css

    You could also save a good bit with the styles:
    Code:
    a.SmallTextLink,
    a.SmallTextLink:link,
    a.SmallTextLink:visited {
    	font: italic normal 12px "Franklin Gothic Medium";
    	color: #6e6e6e;
    	text-decoration: none;
    }
    a.SmallTextLink:hover,
    a.SmallTextLink:active {
    	color: #f67929;
    }
    No reason to replicate tons of the same styles.
    Last edited by Merri; Feb 18th, 2008 at 02:53 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width