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

标签 css internet-explorer-8 chm

在带有 IE8 的 Windows 7 上,我发现 display: inline-block 工作得很好。但是,我把html文件编译成chm后,chm里面的页面显示不好,好像inline-block没有生效。

有没有办法让chm显示和IE8一样?谢谢。

enter image description here

我的 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>

最佳答案

我终于找到了答案。 A post at west-wind.com告诉我我需要做一个注册表 hack 让 CHM 阅读器 (hh.exe) 使用 IE8 渲染模式,否则,hh.exe 最多使用 IE7。

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

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"hh.exe"=dword:00001f40

好的。至少IE8 M$系统有解决办法。

这个问题与Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?有关

关于css - 为什么页面在 IE8 和 chm 中显示不同(CSS "display: inline-block"问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17042914/

相关文章:

css - 如何在动态高度的 flexbox 中进行 div 拉伸(stretch)?

javascript - jQuery Mustache 不适用于 IE 8

css - CHM 与 css+背景

chm - 是否可以在 CHM(编译的 HTML 帮助)文件中启用视觉样式?

c++ - 使用命令行参数在特定页面/主题打开 .chm 文件

javascript - 滚动时改变颜色

html - 没有绝对位置的div中div的绝对位置

html - 无法使用 Internet Explorer 8 获取@font-face

css - 如何在页脚前引入一个空格

javascript 在 ie8 中不工作