When i click the hyperlink “off” then “on” in the following html sample, (very boiled down code), ie9 crashes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>title</title>
</HEAD>
<BODY>
<DIV style="display: inline;">
<A style="float: left;">always </A>
</DIV>
<DIV style="display: inline;" id="hideMe">
<A style="float: left;">some</A>
<A style="float: left;">times </A>
</DIV>
<DIV style="display: inline;">
<A style="float: left;">always </A>
</DIV>
<DIV>
<A onclick="{document.getElementById('hideMe').style.display = 'inline';}" href="#">on</A>
<A onclick="{document.getElementById('hideMe').style.display = 'none';}" href="#">off</A>
</DIV>
</BODY>
</HTML>
I am unsure what to do next, i can’t see an fundamental problem with the code, it evens passes HTML 4.01 Strict! validation.
any help would be appreciated
I don’t have IE9 to hand to test this, but just looking at the code I would say that the fundamental problem is
floats insideinlineelements.inlineelements are not supposed to contain any block content (including floats).If you need this kind of layout, you should use
display:inline-blockinstead ofinline, although I think the floats will still be unnecessary, as the links should line up to the left within their contain anyway.I think that should solve the problem.
Having said all that, if you’ve crashed the browser then it is a browser bug, regardless of the quality or validity of the code. The browser should be able to deal gracefully with this kind of thing; a crash is bad news. You should report it to Microsoft, even if you do manage to work around it. (it will be particularly helpful for them that you’ve got a simple test case to demonstrate the problem)