Alexancho Posted August 26, 2010 Share Posted August 26, 2010 I want a block contained some elements to be a link.For example: <h1>It is a link:</h1><a href="http://www.google.com/"><span style="display:block; width:150px; height:150px; background:#babadf;"><span style="display:block; width:50px; height:50px; background:#acdefb;"></span></span></a> It works in FF, but in IE it behaves different. It is actually a link, but cursor doesn't change over this area and you can't use "Open in New Tab" or "Open in New Window" option. How to make this link behave in IE the same way as it behaves in FF? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 26, 2010 Share Posted August 26, 2010 just add cursor: pointer; to outer span.<h1>It is a link:</h1><a href="http://www.google.com/"><span'>http://www.google.com/"><span style="display:block; width:150px; height:150px; background:#babadf; cursor:pointer;"><span style="display:block; width:50px; height:50px; background:#acdefb;"></span></span> and you can't use "Open in New Tab" or "Open in New Window" option. How to make this link behave in IE the same way as it behaves in FF?in transitional doctype you would use<a href="http://www.google.com/" target="_blank">in strict you would have to use javascript<script type="text/javascript">/*<![CDATA[*//*---->*/function gohere(element){document.getElementById(element.id).target="_blank";}/*--*//*]]>*/</script><a href="http://www.google.com/" id="thislink1" onclick="gohere(this)"> Link to comment Share on other sites More sharing options...
Alexancho Posted August 26, 2010 Author Share Posted August 26, 2010 Yes, thank you.But "cursor:pointer;" affects a cursor behavior, but still you can't use "Open in New Tab" or "Open in New Window" option. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 26, 2010 Share Posted August 26, 2010 either do this<h1>It is a link:</h1><a href="http://www.google.com/" style="display:block; width:150px; height:150px;"><span style="display:block; width:150px; height:150px; background:#babadf; cursor:pointer;"><span style="display:block; width:50px; height:50px; background:#acdefb;"></span></span></a>or this <h1>It is a link:</h1><a href="http://www.google.com/" style="display:block; width:150px; height:150px;background:#babadf; "><span style="display:block; width:50px; height:50px; background:#acdefb;"></span></a> Link to comment Share on other sites More sharing options...
Alexancho Posted August 26, 2010 Author Share Posted August 26, 2010 Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.