【发布时间】:2011-07-04 22:06:07
【问题描述】:
这让我发疯:
<ul>
<li style="position:relative;border:1px solid green">
<p>some content...</p>
<p>some content...</p>
<a style="position:absolute; left:0; top:0; width:100%; height:100%; background:red; display:block">a mask over whole list item</a>
</li>
</ul>
我以各种形式遇到过这个问题(例如定位角图形、尝试在列表项上创建蒙版等)
无论我尝试什么,我都无法让 ie6 绝对定位列表项中的元素。另一个例子:
<ul>
<li style="position:relative;border:1px solid green">
<p>some content...</p>
<p>some content...</p>
<div style="position:absolute; left:0; top:0; width:20px; height:20px; background:red; display:block"></div>
<div style="position:absolute; right:0; top:0; width:20px; height:20px; background:green; display:block"></div>
<div style="position:absolute; left:0; bottom:0; width:20px; height:20px; background:blue; display:block"></div>
<div style="position:absolute; right:0; bottom:0; width:20px; height:20px; background:yellow; display:block"></div>
</li>
</ul>
【问题讨论】:
-
您是否在怪癖模式下运行?你的文档类型是什么?
-
嗨 MP,仅供参考,您可以使用 CTRL-K 缩进整个代码块并保留格式 - 或手动将代码缩进至少 4 个空格,它将被正确处理。
标签: internet-explorer-6 css-position