代码之家  ›  专栏  ›  技术社区  ›  Tom Ritter

IE6中的CSS溢出问题-元素未出现/显示

  •  0
  • Tom Ritter  · 技术社区  · 16 年前

    唯一比IE6中的CSS问题更糟糕的是IE6中的CSS问题 不同的 来自其他人的。

    我有一个div,具有固定的宽度和高度,溢出设置为滚动。它适用于IE7/8、FF、Chrome等。 div是 看不见的 。它没有出现。 就好像我把显示器放在上面了:没有。

    如果我删除溢出,它就会出现。重新打开-消失。

    正常情况下,我可以通过谷歌搜索来解决这样的问题,但我以前找不到任何人遇到过这种错误。 This is irrelevant ,则, this looked promising 但没有帮助。

    以下是div结构:

    <div style="width: 640px; position: absolute; z-index: 100001; left: 312px; top: 59.5px;min-height:0;">
        <div style="width: 100%; min-height:0px" >
    =>      <div style="height: 450px; overflow-y: scroll; overflow-x: hidden; padding-right: 17px; min-height:0px;">
                <div style="min-height:0px;">
                    <div style="min-height:0px;">
                        <table style="width:100%;border-collapse:collapse;">
                        //lots of rows
                        </table>
                        <input type="hidden" />
                    </div>
                    <input type="hidden" /><input type="hidden" />
                </div>
            </div>
            <div class="cColHeaderBG" style="text-align: right;"> //Shows up fine
                <input type="button" />
                <button>Save</button>  
            </div>
        </div>
    </div>
    

    我知道它很毛茸茸的,很多都是ASP。Net AJAX呈现其弹出面板。

    1 回复  |  直到 16 年前
        1
  •  1
  •   Tom Ritter    16 年前

    解决办法是改变

    <div style="height: 450px; overflow-y: scroll; 
    

    <div style="height: 450px !important; overflow-y: scroll; 
    

    我不知道为什么这会起作用(没有其他风格规则被应用到任何地方),但它确实起了作用。希望它能帮助其他人。