您好我有一个包含此css文件的母版页
html, body{
width:100%;
height:100%;
}
#form1 {
position:relative;
height:100%;
width:100%;
}
.header {
position:relative;
height:10%;
width:100%;
background-color: #b9df66;
color: #FFF;
font-size: 10pt;
font-weight: bold;
padding-right: 5px;
border-bottom: 1px solid #000;
}
.quote {
position:relative;
height:2%;
width: 100%;
background-color: #EEE;
color: #000;
font-size: 8pt;
font-weight: bold;
padding: 2px;
border-bottom: 1px solid #000;
text-align: right;
}
.content
{
position:relative;
float:right;
height:80%;
width:80%;
border:3px solid blue;
}
.contentleft {
position:relative;
height:80%;
width:16%;
float:left;
background :RGB(238,238,238);
border: 1px solid red;
}
这是MasterPage的html
<head runat="server">
<title></title>
<link href="Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="header" >Bohemia
</div>
<div class="quote" >Because We are awesome </div>
<div class="content" id="content" runat="server" >
<asp:ContentPlaceHolder ID="ContentPlaceHolderMainMenu" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="contentleft">
<asp:ContentPlaceHolder ID="ContentPlaceHolderLeftMenu" runat="server"/>
<asp:Label runat="server" ID="lblproba" />
</div>
</form>
</body>
使用ygismaster页面的页面的html
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Search_FormMP.aspx.cs"
Inherits="Tanya_Marinova_FN_0801262079_reservation_system.Search_FormMP" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMainMenu" runat="server">
<asp:GridView ID="GridViewCustomers" runat="server" AutoGenerateColumns="False"
AllowPaging="True" datakeynames="Reservation_ID,Excursion_ID"
onpageindexchanging="GridViewCustomers_PageIndexChanging"
onrowcommand="GridViewCustomers_SelectedIndexChanged"
onrowdatabound="GridViewCustomers_RowDataBound" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" >
<Columns>
</Columns>
</asp:GridView>
<asp:Label ID="LabelSelectedItem" runat="server"></asp:Label>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderLeftMenu" runat="server">
</asp:Content>
无论我做什么,它都不占用整个页面!可能是什么问题
答案 0 :(得分:0)
在您的页面中似乎缺少<html>
元素
请务必在模板中添加严格的文档类型,例如<!DOCTYPE html>