PDA

View Full Version : IE won't link an empty div?



grassmeyer
09-26-2007, 03:51 AM
Why does this code not work in IE?

<a href="index.php"><div style="position:absolute; height:100px; width:400px; top:0px; left:0px; cursor: pointer; cursor: hand;"></div>
</a>

Example:
http://www.freetoexplorebeauty.co.uk/index.php?

Making the logo area up top clickable. . .?

Jen

codeexploiter
09-26-2007, 04:18 AM
You can insert some temporary text in the div make the text color white. Make sure that the text entered in the div has a overflow: hidden property set and also the text should be filled the div completely.

coothead
09-26-2007, 11:09 AM
Hi there grassmeyer,

it is not permissible to place block-level elements within inline elements. :eek:

Instead, do it like this...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
a {
display:block;
width:419px;
height:99px;
background-image:url(http://www.freetoexplorebeauty.co.uk/skins/free2ex/images/logo.gif);
}
</style>

</head>
<body>

<div>
<a href="index.php"></a>
</div>

</body>
</html>

coothead