Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a: hover class works in IE not mozilla

Status
Not open for further replies.

jdbolt

Programmer
Aug 10, 2005
89
CA
I have encountered some strange behavious, my code below works fine in mozilla, however in IE, the link style does not change on hover! Does anyone have any ideas? Is this a known bug?



Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
a.tooltip
	{
	border:1px solid #CCCCCC;
	margin-left:15px;
	padding-left:5px;
	padding-right:5px;
	background-color:#edeff1;
	color:#000000;
	font-size:11px;
	}
	
a.tooltip:hover
	{
	border:1px solid #003366;
	padding-left:5px;
	padding-right:5px;
	background-color:#5286bd;
	color:#FFFFFF;
	font-size:11px;
	text-decoration:none;
	}
-->
 </style>
</head>
<body>
<a class="tooltip">vdsff</a>

</body>
</html>
 
give it a href and remove the commenting from the style sheets.

Code:
<a href="#" class="tooltip">

Code:
<style type="text/css">
a.tooltip
    {
    border:1px solid #CCCCCC;
    margin-left:15px;
    padding-left:5px;
    padding-right:5px;
    background-color:#edeff1;
    color:#000000;
    font-size:11px;
    }
    
a.tooltip:hover
    {
    border:1px solid #003366;
    background-color:#5286bd;
    color:#FFFFFF;
    text-decoration:none;
    }
 </style>

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
To further explain cLFlaVA's solution, IE only accepts pseudo classes on anchor elements, when they are actually links. It is the limit of IE, a pretty annoying limit at that. So you need to follow advice given and give your link a dummy href.
 
always there to explain what i'm too lazy to explain...

:)

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top