2009-07-24 51 views
0

http://img520.imageshack.us/img520/6951/723200995413pm.pngIE6 - 元素弹出进出

正如你可以从图片上面看,在IE6的div以基本相同的标记和CSS有时弹出进出的位置,当我移动鼠标。我没有在他们的任何悬停效果...

HTML标记

<pre>&lt;div class=&quot;block yellow shieldalert&quot;&gt; 
    &lt;div class=&quot;content&quot;&gt; 
    &lt;h6&gt;Shield Alert&lt;/h6&gt; 
    &lt;pre class=&quot;brush:xhtml&quot;&gt; 
    &lt;!-- content for syntax highlighting --&gt; 
    &lt;/pre&gt; 
    &lt;/div&gt; 
&lt;/div&gt;</pre> 

CSS(部分)

<pre>div.block { 
    border: 1px solid; 
    padding-left: 32px; 
    margin: 5px 0; 
    background-repeat: no-repeat; 
    background-position: 8px 5px; 
    background-color: #ebebeb; 
    border-color: #d7d7d7; 
} 

div.content { 
    background-color: white; 
    padding: 2px 10px 1px 10px; 
    border-left: 1px solid #d7d7d7; 
} 

div.yellow { 
    background-color: #fff67f; 
    border: 1px solid #e6e089; 
} 
div.yellow div.content { 
    background-color: #fffde0; 
    border-left: 1px solid #e6e089; 
} 

div.yellow h1, div.yellow h2, div.yellow h3, div.yellow h4, div.yellow h5, div.yellow h6 { 
    color: #cfcd13; 
} 

div.shieldalert { 
    background-image: url(../images/div/info-shieldalert.png); 
}</pre> 
+0

CSS:悬停不适用于除IE6中锚定标记之外的任何内容。你有什么JS? – peirix 2009-07-24 06:48:30

+0

js。是的,但是......它有关系吗?我不认为任何js修改/在受影响的div上工作。 – iceangel89 2009-07-24 07:34:08

回答

2

我也发现,当你有东西闪烁/ peek-a-boo(ing)有问题时,将高度设置为1%有时会有帮助。在上面。我经常制定一个规则:

* html .ie6-fix 
{ 
    height: 1%; 
} 

然后将这个类应用于任何给ie6带来麻烦的东西。无论如何,除了Internet Explorer,这在浏览器中都会被忽略。