1
以下是我在IE 6版運行時遇到的一些代碼版本。它似乎在IE 7,IE 8,FireFox和Google Chrome中運行良好。但是在IE 6中,當我在樹視圖中展開和摺疊節點時,SurroundingWrapper div調整大小,但底部的消息保持粘貼位置(我寧願將它粘在div SurroundingWrapper的底部)。有人可以告訴我爲什麼這段代碼在IE 6中崩潰嗎?在IE 6中調整Div大小Divider 6
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
<style type="text/css">
#SurroundingWrapper
{
position: relative;
border: 1px solid #D0D0D0;
width: 800px;
min-height: 20px;
margin-top: 10px;
margin-bottom: 20px;
padding: 20px;
background-color: White;
line-height: 1.2em;
}
.Message
{
position: absolute;
display: block;
width: 100%;
text-align: center;
font-size: 11px;
color: Gray;
bottom: 2px;
min-height: 0px;
}
</style>
<!--[if lte IE 7]>
<style type="text/css">
#SurroundingWrapper
{
height: auto !important;
height: 20px;
}
.MessageIe6and7Fix
{
width: 100%;
}
</style>
<![endif]-->
<!--[if lt IE 7]>
<style type="text/css">
.MessageIe6Fix
{
height: 1px;
}
</style>
<![endif]-->
</head>
<body>
<form id="form1" runat="server">
<div id="SurroundingWrapper">
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1">
</asp:TreeView>
<div class="Message MessageIe6and7Fix MessageIe6Fix">
This is a message at the bottom of the page.</div>
</div>
</form>
</body>
</html>
而且,這裏的相關網站地圖文件的樹狀視圖:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Default.aspx" title="Level 1" description="">
<siteMapNode url="~/A.aspx" title="Level A" description="">
<siteMapNode url="~/a1.aspx" title="Level a" description="" />
<siteMapNode url="~/b1.aspx" title="Level b" description="" />
</siteMapNode>
<siteMapNode url="~/B.aspx" title="Level B" description="">
<siteMapNode url="~/a2.aspx" title="Level a" description="" />
<siteMapNode url="~/b2.aspx" title="Level b" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
許多在此先感謝!
安德魯