Bootstrap:无法为网格行添加背景颜色

时间:2017-03-12 22:15:20

标签: html css twitter-bootstrap

我是Bootstrap的新手。我正在一个非常简单的网站上工作。但是,我在向行添加背景颜色属性时遇到问题。我希望有人可以帮我找出我出错的地方

这是我的HTML文件

<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head 
         content must come *after* these tags -->

    <title>Pizza Store</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-theme.min.css" rel="stylesheet">  
    <link href="css/mystyles.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <header class="jumbotron">
        <div class="container">
            <div class="row">
                <div class="col-xs-12 col-sm-8">
                    <h1>Pizza Store</h1>
                </div>
            </div>
        </div>
    </header>

    <div class="containter">
        <div< class="row menu-content">
            <div class="col-xs-12">
                <hr>
            </div>
            <div class="col-xs-12 col-sm-8">
                <h3>Vegetable Pizza</h3>
            </div>
            <div class="col-xs-12 col-sm-4">
                A Pizza with Vegetables on it
            </div>

            <div class="col-xs-12">
                <hr>
            </div>
        </div>
        <div< class="row menu-content">
            <div class="col-xs-12">
                <hr>
            </div>
            <div class="col-xs-12 col-sm-8">
                <h3>Cheese Pizza</h3>
            </div>
            <div class="col-xs-12 col-sm-4">
                A Pizza with only cheese
            </div>

            <div class="col-xs-12">
                <hr>
            </div>
        </div>
    </div>
</body>

这是mystyle.css文件

.row-header{
    margin:0px auto;
    padding:0px auto;
}

.menu-content {
    margin:0px auto;
    padding: 50px 0px 50px 0px;
    border-bottom: 1px ridge;
    min-height:400px;
    background-color: #76A0D3;
}

.row-footer{
    background-color: #AfAfAf;
    margin:0px auto;
    padding: 20px 0px 20px 0px;
}

.jumbotron {
    padding:70px 30px 70px 30px;
    margin:0px auto;
    background: black;
    color: white;
}


address{
    font-size:80%;
    margin:0px;
    color:#0f0f0f;
}

hr {
   display: block;
   position: relative;
   padding: 0;
   margin: 8px auto;
   height: 0;
   width: 100%;
   max-height: 0;
   font-size: 1px;
   line-height: 0;
   clear: both;
   border: none;
   border-top: 1px solid #aaaaaa;
   border-bottom: 1px solid #ffffff;
}

除菜单内容类样式外,所有类都正常工作。在那个类中,唯一不起作用的是background-color属性。有人可以解释一下为什么会这样吗?

感谢您的帮助

0 个答案:

没有答案