简体   繁体   English

为什么项目符号未在IE6中显示

[英]Why bullet not shown in IE6

It shows in firefox,but no in IE(in fact mine is IE6) 它在Firefox中显示,但在IE中没有显示(实际上我的是IE6)

<style type="text/css">
 li { list-style-type:disc; }
</style>

<div style="margin: 2px auto 15px; padding: 5px 0px; width: 480px; text-align: center;">
<ul style="margin: 0; padding: 0; text-align: left; list-style-position: outside; overflow: visible;">
 <li ><em>test.</em> 111</li>
 <li><em>test.</em> 2</li>
</ul>
</div>

Can take a look here: link text 可以在这里看看: 链接文本

EDIT All requirements: 编辑所有要求:

1.remain the parent div with width fixed. 1.保持父div的宽度固定。

2.must make <ul> text-align:left; 2.必须使<ul> text-align:left;

3.show the bullets 3.显示子弹

Try messing with the margin/padding on the ul and give layout to the lis possibly? 尝试弄乱ul上的边距/填充并为lis分配布局吗?

ul { margin:0 0 0 10px; padding:0 0 0 10px; }
ul li { zoom:1; }

I forget which one IE cares about but it needs enough space to show them. 我忘记了哪个IE在乎,但它需要足够的空间来显示它们。

The left edge of lists is always at the text, not the bullet points. 列表的左边缘始终在文本上,而不是项目符号点。 In other words, the bullet points are outside the list's bounding box, which makes them disappear for some reason in IE. 换句话说,项目符号点不在列表的边界框之内,这使它们由于某种原因在IE中消失了。

Add some left-padding to the list (at least 20px should do it). 在列表中添加一些left-padding (至少20px应该可以)。

I think you also want to add a doctype to the page - on your example page the list should be centrally aligned, but it isn't for me (in IE8) because IE is in quirks mode. 我认为您还想在页面上添加doctype-在示例页面上,列表应集中对齐,但这不适合我(在IE8中),因为IE处于怪癖模式。

because of the CSS width attribute. 由于CSS width属性。

I suggest you set the width attribute to the li tag instead of the ul 我建议您将width属性设置为li标签而不是ul


Edit 编辑

list-style-position: outside; can make the same problem happen on Firefox 可以在Firefox上发生同样的问题

You will have to find another way to style the list, but if you insist on list-style-position: outside; 您将不得不寻找另一种样式化列表的方式, 但是如果您坚持使用list-style-position: outside; you can use javascript to set the width attribute in the suitable place. 您可以使用javascript在适当的位置设置width属性。

i know it`s old style but this should work 我知道它很旧,但是应该可以

<li type="disc">... </li>

it might work.. ie has a lot of problem with css.. problems that will be fixed.. 它可能会工作..即css有很多问题..问题将被修复..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM