Remove the span tag, I donβt think you need it
<div style="width: 200px; height: 200px;"> <a href="http://www.mylink.com" style="display: block; width: 100px; height: 100px;"> <img src="img.jpg" alt="My image"/> </a> </div>
If you have control over the layout, extract the inline styles and use
<div id="link"> <a href="http://www.mylink.com"> <img src="img.jpg" alt="My image"/> </a> </div>
Add a link to an external stylesheet at the beginning of the document.
<head> <link rel="stylesheet" type"text/css" href="/Css/Style.css"/> </head>
Create style.css and add
div#link { width: 200px; height: 200px; } div#link a { display: block; width: 100px; height: 100px; }
If you use this link style in several places, remove the id on the div and replace it with
<div class="link"> ... </div>
And change the selector in c # css to.
div.link ...
If you have problems only in IE6, you can also use conditional comments to include a style sheet that fixes specific IE6 problems.
<head> </head>
source share