简体   繁体   English

CSS-IE6溢出

[英]CSS - IE6 overflow

I can see some other question have been raised around this issue but none of the answers fixed it for me. 我可以看到有关此问题的其他问题,但没有一个答案可以解决。

I have a table which is inside a <div> . 我有一个在<div>内的表。 In IE7 and above this renders fine and the table can be seen clearly using scroll bars. 在IE7及更高版本中,此效果很好,使用滚动条可以清楚地看到表格。 In IE6 however this renders as a single line (eg height of 1px). 但是,在IE6中,它呈现为单行(例如1px的高度)。

Here is the css around these elements. 这是围绕这些元素的CSS。

    DIV.ScrollFrame {
        overflow: auto;
        height: 100%;
    }

    .DataTable {
        border-collapse:collapse;
    }

Then the html look like this 然后html看起来像这样

<div class="ScrollFrame" >
    <table class="DataTable">
        //some asp to generate the data
    </table>
</div>

Sorry a cannot provide pictures as the data in the table is confidential. 抱歉,由于表格中的数据是机密信息,因此无法提供图片。

Thank you in advance. 先感谢您。

嗯,我不确定,但是您可以在ie6上尝试一下:

* html DIV.ScrollFrame { overflow:scroll; }

If your solution is to set a fixed height, make sure you serve it for IE6 only. 如果您的解决方案是设置固定高度,请确保仅将其用于IE6。 Best practice is to use an IE6 only stylesheet displayed with conditional comments, like so: 最佳做法是使用仅显示条件注释的IE6样式表,如下所示:

<!--[if IE 6]>
        <link href="/styles/ie6.css" rel="stylesheet" media="screen, print"/>
<![endif]-->

Alternatively you can use the * html hack, which only IE6 understands. 另外,您也可以使用* html hack,只有IE6可以理解。

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

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