嘿,这是我的第一篇文章,我是asp.net的初学者。我在使用母版页时遇到问题。我有一个六页的网站和一个主页面,四个页面的布局是完美的,两个页面将页脚放到高位(在页面的中间)。所有的页面长度相同,所以我不确定为什么这样做。以前有人遇到过这个问题吗?
以下是母版页中的代码。
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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 id="Head1" runat="server">
<title></title>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.menu
{
background-color: #FFFF00;
}
.hideSkiplink
{
background-color: #FFFF00;
width: 1260px;
height: 23px;
}
.footer
{
background-color: #FFFF00;
width: 1257px;
height: 23px;
margin-top: 33px;
}
.main
{
width: 726px;
height: 709px;
margin-top: 49px;
margin-bottom: 38px;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1 style="width: 1255px">
<asp:Label ID="lblTitle1" runat="server" Font-Bold="True" Font-Italic="True"
Font-Size="XX-Large" ForeColor="Blue" Text="Sports Pro"></asp:Label>
<br />
<asp:Label ID="lbltitle2" runat="server" Font-Size="Large" ForeColor="Red"
Text="Sports managment software for the sports enthusiast"></asp:Label>
</h1>
</div>
<div class="clear hideSkiplink">
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
Height="16px" Width="59px" Orientation="Horizontal">
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" ViewStateMode="Disabled" />
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server">
<p style="height: 708px; width: 725px; margin-bottom: 48px;">
<br />
</p>
</asp:ContentPlaceHolder>
</div>
</div>
<div class="footer">
To contact us, call us at 800-555-0400 or email us at <a href="mailto:sportspro@sportsprosoftware.com">sportspro@sportsprosoftware.com</a></div>
</form>
</body>
</html>