Bootstrap行背景粘在白色,无法更改

时间:2016-02-18 16:38:41

标签: html css html5 twitter-bootstrap twitter-bootstrap-3

我的问题是我的行有背景,我从来没有为那些指定背景颜色。我尝试为每个作为文本的cols创建一个类,因此它们具有不同的bg,并将其他col单元格保持为空透明bg。

但这是我得到的: my problme

这是我的代码

<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Imprimerie Serval</title>

<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/full.css" rel="stylesheet">

<!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#"><img src="logo600s.svg" height="175" width="175" style="float:left;"></a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="#">Acceuil</a>
                </li>
                <li>
                    <a href="#">Services</a>
                </li>
                <li>
                    <a href="#">Contactez-Nous</a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

<!-- page content here! -->
<div class="container" id="mainpage"> 

    <div class="row">
        <div class="col-lg-4">
        </div>
        <div class="col-lg-4">
        </div>
        <div class="greenbg col-lg-4">
            <p>tete</p>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-4">
        </div>
        <div class="graybg col-lg-4">
            <p>tete</p>
        </div>
        <div class="col-lg-4">
        </div>
    </div>

    <div class="row">
        <div class="whitebg col-lg-4">
            <p>tete</p>
        </div>
        <div class="col-lg-4">
        </div>
        <div class="col-lg-4">
        </div>

    </div>

</div>
<!-- jQuery -->
<script src="js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>

这是我的CSS:

    body {
    margin-top: 50px; /* Required margin for .navbar-fixed-top. */
}

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

@media(min-width:767px) {
    .navbar {
        background: rgba(255,255,255,0);
        border:0px;
        margin:50px;
    }

    /* title */
    .navbar .navbar-brand {
        font-size:24px;
        text-shadow: 0 0 10px #000;
        font-weight:bold;
        color: rgb(35,154,123);
    }

    .navbar-inverse .navbar-brand:hover,
    .navbar-inverse .navbar-brand:focus {
        color: #5E5E5E;
    }
    /* link */
    .navbar-inverse .navbar-nav > li > a {
        text-shadow: 0 0 10px #000;
        color: #fff;
        font-size: 18px;
    }
    .navbar-inverse .navbar-nav > li > a:hover,
    .navbar-inverse .navbar-nav > li > a:focus {
        border-bottom:  5px solid rgb(35,154,123);
        background: rgba(255,255,255,0);
    }
    .navbar-inverse .navbar-nav > .active > a, 
    .navbar-inverse .navbar-nav > .active > a:hover, 
    .navbar-inverse .navbar-nav > .active > a:focus {
        color: #555;
        background-color: #E7E7E7;
    }

    #mainpage {
        margin-top:350px;
    }
    .greenbg {
        background:rgb(35,154,123);
    }

    .graybg {
        background:rgb(190,190,190);
    }

    .whitebg {
        background:rgb(255,255,255);
    }
}

0 个答案:

没有答案