如何使页面内容从母版内容开始?

时间:2019-01-25 11:23:03

标签: html css asp.net

我想创建一个主页,但是当我在页面中输入内容时,它位于我的母版页中的导航菜单和徽标上方,我该如何创建它,以便页面内容将从内容下方开始母版页?

母版页代码:(导航菜单和徽标)

<html>
<head runat="server">
<title>Eliyahu's Website</title>

<asp:ContentPlaceHolder ID="head" runat="server">    
</asp:ContentPlaceHolder>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<style type="text/css"></style>
</head>

<body>   
<header>
    <div class="row">
        <div class="logo">
            <img src="pictures/logo.png" />
        </div>

        <ul class="main-nav">
            <li class="active"><a href="HomePage.aspx">HOME</a></li>
            <li><a href="GalleryPage.aspx">GALLERY</a></li>
            <li><a href="AboutPage.aspx">ABOUT</a></li>
            <li><a href="RegistrationPage.aspx">REGISTRATION</a></li>
            <li><a href="ContactUsPage.aspx">CONTACT US</a></li>
        </ul>
    </div>     
</header>
<asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>

主页代码:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" 
AutoEventWireup="true" CodeBehind="HomePage.aspx.cs" 
Inherits="EliyahuWeb.HomePage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" 
runat="server"
<div class="articletitle">
    <h1>Hello World</h1>
</div>
</asp:Content>

看起来如何: Screenshot

0 个答案:

没有答案