为什么页面在IE8和chm中显示不同(CSS"display:inline-block"问题)

Jim*_*hen 5 css chm internet-explorer-8

在带有IE8的Windows 7上,我发现display: inline-block效果很好.但是,在我将html文件编译成chm后,chm中的页面显示效果不佳,好像inline-block没有任何效果.

有没有办法让chm显示与IE8相同?谢谢.

在此输入图像描述

我的html源代码是:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>title to fill</title>
<meta charset="utf-8">
<style type="text/css">
#topcanvas {
    z-index: 0;
    top: 0; 
    left:0;
    width:100%;
}

#chjnavi {
    font-size: 10pt;
    background-color: #eee;

    padding: 0em 1em;
    list-style-type: none;  
    position: relative;
    z-index: 0;
}

#chjnavi ul {
    margin: 0;
    padding: 0;
}

#chjnavi li {
    margin: 0;
    padding: 8px;
    display: inline-block;
        /* !!! */

    cursor: pointer;
}

</style>
</head>

<div id="topcanvas">
<div id="chjnavi">
    <ul id="navibar_topul">
        <li id="gentoc-t">item 1</li>
        <li id="codecolor-t">item 2</li>
        <li id="linenum-t">item 3</li>
    </ul>
</div>
</div>
<p> My text. </p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Jim*_*hen 2

我终于找到答案了。west-wind.com 上的一篇文章告诉我,我需要进行注册表破解才能让 CHM 阅读器(hh.exe)使用 IE8 渲染模式,否则 hh.exe 最多使用 IE7。

注册表破解方法是:将以下代码保存到 .reg 文件,然后双击导入到注册表中。

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"hh.exe"=dword:00001f40
Run Code Online (Sandbox Code Playgroud)

好的。至少IE8 M$系统有解决方案。

此问题与IE9 WebBrowser 控件是否支持所有 IE9 功能(包括 SVG)相关?