0

我开始使用“Beginning ASP.NET 4 : in C# and VB”一书来学习 ASP.NET(Imar Spaanjaars - Wrox)。现在我被困在第 79 页的“尝试一下”部分:除了侧边栏没有背景颜色,预计它是灰色的之外,一切都很顺利。

我的页面:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            color: #663300;
        }
        .style2
        {
            color: #FF0066;
        }
    </style>
    <link href="Styles/Styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="PageWrapper">
        <div id="Header">
            Header Goes Here
        </div>
        <div id="MenuWrapper">
            Menu Goes Here
        </div>
        <div id="MainContent">
            <h1>
                Hi there visitor and welcome to Planet Wrox</h1>
            <p>
                We&#39;re glad you&#39;re <span class="style2">paying a visit</span><span class="style1">
                </span>to <a href="http://www.PlanetWrox.com">www.PlanetWrox.com</a>, the coolest
                music community site on the Internet.</p>
            <p>
                Feel free to have a look around; there are lots of interesting <strong>reviews and concert
                    pictures </strong>to be found here.</p>
        </div>
        <div id="SideBar">
            Sidebar Goes Here</div>
        <div id="Footer">
            Footer Goes Here
        </div>
    </div>
    </form>
</body>
</html>

CSS 文件:

#Header
{
    background-color: #C0C0C0;
    width: 844px;
    height: 86px;
}

*
{
    font-family: Arial;
}

h1
{
    font-size: 20px;
}

#PageWrapper
{
    width: 844px;
}

#MenuWrapper
{
    width: 844px;
}

#MainContent
{
    width: 664px;
    float: left;
}

#Sidebar
{
    background-color: Gray;
    width: 180px;
    float: left;
}

#Footer
{
    background-color: #C0C0C0;
    width: 844px;
    clear: both;
}

结果(侧边栏背景预计为灰色): 在此处输入图像描述

我是不是搞错了,谁能告诉我在哪里?

4

1 回答 1

5

“边栏”!=“边栏”

区分大小写

于 2013-03-19T15:21:05.523 回答