-4

这是 HTML/Razor 视图:

 </head>
    <body>
        <header>
            <div class="divHeader">
                Title Here
            </div>
            <div class="divMenu">
               <nav>
                    <ul id="menu">
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        <li>@Html.ActionLink("About", "About", "Home")</li>
                        <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                    </ul>
                </nav>
           </div>
        </header>
        <div class="divBody">
            @RenderBody()
        </div>
        <footer>
            <div class="divFooter">
                All Rights Reserved.
             </div>
        </footer>
    </body>
    </html>

这是CSS:

body
{
    margin: 0 auto;
    max-width: 960px;
    padding: 0px;
    background-color: White;
    text-align: center;
}
header
{
    height: 60px;
    background-color: #C0C0C0;
}
footer
{
    height: 20px;
    background-color: #C0C0C0;
}
div.divHeader
{
    color: #006600;
    font-style: normal;
    font-family: Shruti;
    font-size: 3em;
    font-weight: bold;
}
div.divBody
{
    color: #000000;
    font-style: normal;
    font-family: Georgia;
    font-size: small;
    font-weight: normal;
    text-align: left;
}
div.divFooter
{
    color: #006600;
    font-style: italic;
    font-family: Shruti;
    font-size: 0.75em;
    font-weight: bold;
}
header div.divMenu
{
    position: relative;
}

/* menu
----------------------------------------------------------*/
ul#menu {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
    text-align: left;
}

    ul#menu li {
        display: inline;
        list-style: none;
        padding-right: 15px;
    }

        ul#menu li a {
            background: none;
            color: #999;
            text-decoration: none;
        }

        ul#menu li a:hover {
            color: #333;
            text-decoration: none;
        }
4

1 回答 1

0

它只是视觉上的,渲染是正确的,但是您的 css 样式给 divheader 的高度小于它,除了包含菜单。

于 2012-06-06T16:48:53.017 回答