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上工作?
解决方法
使用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.
原文地址:https://www.jb51.cc/html/223884.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。