Rks*_*ass 33 html html-lists internet-explorer-9
我有一个<ol>(有序列表),在FF,Safari,Chrome中它可以正确呈现.但是在IE9中它显示全部为零.这不是间距/填充问题,因为我能够看到零.
我的HTML如下:
<ol>
<li>Enter basic company information</li>
<li>Select from our portfolio of products</li>
<li>Attach your employee census</li>
<li>Review your selections and submit your request.</li>
</ol>
Run Code Online (Sandbox Code Playgroud)
任何人遇到这个问题,希望是一个解决方案?

Ian*_*oyd 27
此回归已在Internet Explorer 10(所有文档模式)中得到修复.Microsoft已删除Connect条目,因此您无法查看其状态.由于微软现在自动推出IE10,它应该适用于所有常客.
这是已知的IE9回归,已在Microsoft Connect上报告:
类型:错误
ID:657695已
打开:4/6/2011 12:10:52 PM
访问限制:公开0解决方法
5用户可以重现此错误
更新:
Microsoft发布于2011年6月14日下午3:20
感谢您的反馈.我们能够重现这个问题并正在调查它.
最好的祝福,
Internet Explorer团队
重现bug的HTML页面:
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>IE9 Ordered List Zero Bug</TITLE>
<SCRIPT type="text/javascript">
setTimeout(function ()
{
document.getElementById("dv1").innerHTML = "<ol><li>XXX</li><li>YYY</li></ol>";
var container = document.createElement('span');
container.style.cssText = "display:none";
document.getElementById("dv2").appendChild(container);
}, 1000);
</SCRIPT>
</HEAD>
<BODY>
<DIV id="dv1">
<OL>
<LI>AAA</LI>
<LI>BBB</LI>
</OL>
</DIV>
<DIV id="dv2"></DIV>
</BODY>
</HTML>
Run Code Online (Sandbox Code Playgroud)
解决方法是在您的后面放置一个空元素DIV:
<div id="one">
<ol>
<li>one</li>
<li>two</li>
</ol>
</div>
<div id="two" style="display:none">
<ol>
<li>three</li>
<li>four</li>
</ol>
</div>
<div id="empty"></div>
Run Code Online (Sandbox Code Playgroud)
Internet Explorer 9(9.0.8112.16421)
Internet Explorer 8(8.0.6001.19048)
Internet Explorer 7(7.0.6000.16982):正常工作
谷歌浏览器10(10.0.648.134):作品
另一个解决方
显示元素:
el.show();
然后:
setTimeout(function(){
$("ol").css("counter-reset", "item")
}, 1);