html - Link around inline-block span and Internet Explorer -


the following works fine in chrome , firefox, , makes container clickable. in internet explorer clickable too, change cursor indicate inner div, not either span.

i can fix cursor:pointer, more importantly not allow right click open in new tab.

is there solution problem? thanks!

<html>   <head>     <style type="text/css">        span{display:inline-block;width:100px}     </style>   </head>   <body>     <a href="/">       <div>         <div>title</div>         <span>text</span><span>text</span>       </div>     </a>   </body> </html> 

your html invalid, although browsers expect, never validate.

as clickable div, can use jquery want:

$(function (){     $("#clickme").click(function(event) {         event.preventdefault();         window.open('http://www.whatever.com');     }); }); 

example here.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -