【问题标题】:Issues with IE6 panels in asp.net application?asp.net 应用程序中的 IE6 面板问题?
【发布时间】:2011-12-17 04:39:59
【问题描述】:

我遇到了 IE6 的对齐问题。代码在 IE8 上工作得很好。我别无选择,只能支持 IE6。

说明:

我的网页包含两个页面。

page1(IE6) 的问题:

我在 page1 中有两个面板,每个面板都有一个网格视图。我想在页面中放置带有一些分组文本的面板。随着网格视图数据的不断增长,我想保持两个面板在左侧水平对齐页面的一侧和页面的右侧。所以它在 IE8 中完全可以工作,但是当我切换到 IE6 时,面板会在另一个上方垂直对齐。

这里是代码

<div>
     <div style="float: left">
            <table width="100%">
                <tr>
                    <td>
                        <asp:Panel ID="pnlUsers" runat="server" GroupingText="UserDetails "Wrap="true">

                        </asp:Panel>
                    </td>
                </tr>
            </table>

        </div>



 <div style="float: right">
            <table align="center" width="100%">
                <tr>
                    <td>
                        <asp:Panel ID="pnlLocation" runat="server" GroupingText="Location Details" Wrap="true">

                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </div>
</div>

Page2(IE6) 问题

所以在这个页面中,面板的最大高度没有被采用,它垂直延伸,与面板的最大高度无关!!!

    <asp:Panel ID="pnlAge" runat="server"  ScrollBars="Vertical" Width="100%"
            HorizontalAlign="Center" CssClass="pnlAlignmentClass">

            <asp:GridView runat="server" ID="gvages" AutoGenerateColumns="False" CellPadding="4"  Width="100%">
</asp:GridView>

        </asp:Panel>

CSS:

.pnlAlignmentClass
    {
        max-height: 310px;
        overflow: auto;
    }

如果有人能提出正确的道路,我将不胜感激。

【问题讨论】:

  • 你能把在 IE6 上看到的 html 贴出来吗?
  • @EmmanuelN 你的意思是屏幕截图吗?

标签: c# asp.net internet-explorer-6


【解决方案1】:

IE6 不支持最大高度。您可以使用常规高度,但在 IE6 中它实际上表现得像 min-height。

要在 ie6 中做 max-height,请点击此链接:http://perishablepress.com/press/2007/01/16/maximum-and-minimum-height-and-width-in-internet-explorer/

* html div#division { 
   height: expression( this.scrollHeight > 332 ? "333px" : "auto" ); /* sets max-height for IE */
}

div#division {
   max-height: 333px; /* sets max-height value for all standards-compliant browsers */
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多