1

我的母版页有以下代码。

问题出在 FOOTER 标签上。

 <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MASTER_MasterPage"    %>

 <!DOCTYPE html>

 <html xmlns="http://www.w3.org/1999/xhtml">
 <head runat="server">
 <title></title>
 <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
<script src="../JS/jq.js" type="text/javascript"></script>
<script src="../JS/jqui.js" type="text/javascript"></script>
<script src="../JS/script.js" type="text/javascript"></script>
<style type="text/css">


    html
    {
        background: url(images/bg.jpg) no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }

    #bigDiv
    {
        margin: auto;
        width: 1000px;
        height: 1000px;
        background-color: rgba(255,255,255,0.5);
    }

    header
    {
        height: 100px;
        background-color: white;
        font-family: "Source sans pro";
    }

    #menu a
    {
        text-decoration: none;
        color: white;
    }

    .menuItem
    {
        width: 20%;
        float: left;
        background-color: gray;
        height: 50px;
        font: normal 18px 'Fjalla One',sans-serif;
        color: white;
        padding-top: 30px;
        text-align: center;
        cursor: pointer;
    }

    #contentMain
    {
        float: left;
        width: 80%;
        background-color: rgba(255,255,255,0);
        height: 100%;
        overflow-y: scroll;
    }

    #content
    {
        height: 800px;
        background-color: rgba(255,255,255,0);
        font-family: "Source sans pro";
    }

    #contentAd
    {
        float: left;
        width: 20%;
        background-color: orange;
        height: 100%;
    }

    footer
    {
        text-align: center;
        background-color: gray;
        font-family: "Source sans pro";
        height:100px
    }

        footer a, label
        {
            text-decoration: none;
            color: white;
        }
</style>

</head>
<body>
<form id="form1" runat="server">
    <div id="bigDiv">
        <header>
            <h1>HR Softwares</h1>
            <h4>Advanced softwares and coaching</h4>
        </header>
        <div id="menu">
            <div class="menuItem">HOME</div>
            <div class="menuItem">SERVICES</div>
            <div class="menuItem">PRODUCTS</div>
            <div class="menuItem">CONTACT US</div>
            <div class="menuItem">NEWS</div>
        </div>
        <div id="content">
            <div id="contentMain">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>
            </div>
            <div id="contentAd">
                s
            </div>
        </div>
        <footer>
            <a href="contactus.aspx">Contact us</a>
            <label>| </label>
            <a href="feedback.aspx">Feedback</a>

        </footer>
    </div>

</form>
</body>
</html>

每当我尝试设置 FOOTER 的高度时,页脚的高度在 CONTENT 和 CONTENTMAIN div 的后面,我希望它出现在 CONTENT div 的下方,但它不起作用。

出于测试目的,我将 CONTENT 和 CONTENTMAIN 的不透明度设置为 0,以便您可以看到其后 FOOTER 的高度。我希望 FOOTER 按照流程显示在 CONTENT div 下方。

更新

明确:页脚中的两个都解决了我的问题。总之谢谢大家

4

1 回答 1

0

试试这个,我希望这对你有帮助。CSS

.footer
    {
        text-align: center;
        background-color: gray;
        font-family: "Source sans pro";
        height:100px
    }

HTML

<div class="footer">
            <a href="contactus.aspx">Contact us</a>
            <label>| </label>
            <a href="feedback.aspx">Feedback</a>

        </div>
于 2013-01-07T06:55:13.643 回答