2013-10-10 37 views
0

你好我有一個母版頁與此css文件Web表單不會佔據整個頁面

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; 

} 

這裏是母版

的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頁面的頁面

<%@ 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

在您的網頁似乎<html>元素缺失

記得還添加了一個嚴格的doctype到您的模板,例如<!DOCTYPE html>

+0

不,它does not幫助3 –

+0

你可以在小提琴重現問題? – fcalderan

+0

我認爲問題是我正在使用asp.net母版頁。它看起來不能理解body,html {height:100%;} –