html – IE list-style-position:内部问题

我有list-style-position的问题:在使用IE时内部.在Firefox或Chrome上,它似乎没有这个问题.
ol.myList { list-style-position:inside; }
ol.myList li { padding:20px 10px; font-weight:bold }
ol.myList li p { font-weight:normal }
<ol class="myList" start="1">
    <li>
        <h4>My Title</h4>
        <p>My Details</p>
    </li>
</ol>

在Chrome / Firefox上,它显示如下:

1. My Title
My Details

但是在IE上它显示了这个:

1.
My Title
My Details

任何建议,以使其在IE上工作?

解决方法

这是浏览器之间的不一致. Firefox在单独的行上显示数字/项目符号,IE也是如此.

使用display:h4上的inline-block和* display:inline; zoom:1;对于IE7.

ol.myList li h4 {
    display: inline-block;
    *display: inline;
    zoom: 1;
}

关于此问题的Mozilla文档引用:https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-position#Browser_compatibility

N.B. There is variance among browsers regarding behavIoUr when a block element is placed first within a list element declared as list-style-position:inside. Chrome and Safari both place this element on the same line as the marker Box,whereas Firefox,Internet Explorer and Opera place it on the next line. For more information on this,see this Mozilla 07001 and an 07002.

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些