hover link border

Discussion in 'CSS' started by klown, Jul 9, 2006.

  1. #1
    I'm working on a site that is going to have the menu be links with no border or underline. On hover there will be a border on all four sides. My problem is that when the hover effect takes place the text is pushed to the right where the border was.

    a.menu:link {color: #C30B0B; 
    	font-family: Arial;
    	font-size: 14pt;
    	text-decoration: none;
     }
    
    a.menu:visited {color: #C30B0B; 
    	font-family: Arial;
    	font-size: 14pt;
    	text-decoration: none;
     }
    
    a.menu:hover {color: #C30B0B; 
    	font-family: Arial;
    	font-size: 14pt;
    	text-decoration: none;	
    	border-width: thin;
    	border-style: solid;
    	border-color: #C30B0B;	
    }
    Code (markup):
     
    klown, Jul 9, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    A simple work-around is to make the border of background color for the link, then color it for the hover.
    
    a {
        border: 1px solid white;  /*assuming background is white*/
        }
    
    a:hover {
        border-color: green;
        }
    Code (markup):
    cheers,

    gary
     
    kk5st, Jul 10, 2006 IP
  3. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #3
    that worked thanks for the help.. my design got turned down anyhow! Gotta redo things, guess i made it a little too new tech like.
     
    klown, Jul 10, 2006 IP