Adam Hamilton Adam Hamilton - 6 months ago 14
CSS Question

Change colour background of a div

So today I have been learning how to use Bootstrap(I'm very new) and I have come across a bit of a problem. This is my code:



<!DOCTYPE html>
<html>

<head>
<title>Home</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>

<body>

<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Home</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a>
</li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a>
</li>
</ul>
</div>
</div>
<div class="container">
<div class="jumbotron text-center">
<h1>Welcome!</h1>
<p>Random text here that doesn't matter</p>
<a class="btn btn-default">Watch now!</a>
<a class="btn btn-info">Tweet it</a>
</div>
</div>
</nav>
<div class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<p class="navbar-text pull-left">Site created: 30/05/16</p>
<a href="http://www.youtube.com" class="navbar-btn btn-danger btn pull-right">Subscribe on YouTube</a>
</div>
</div>
</body>

</html>





and basically everything is fine however, if you view my code as .html or whatever in a browser, you will see that under the navigation menu at the top which is black, there is the jumbotron which is fine however, the background of it is black which I don't want, I want it to be white like the rest of the page. I'm so new to this so I can't even manage to figure out how to do this so any help would be highley appreciated. Sorry, I've tried to be as specific as I can but I really am new to this and I'm hoping someone can help me.

TH.

Answer

Get

<div class="container">
<div class="jumbotron text-center">
<h1>Welcome!</h1>
<p>Random text here that doesn't matter</p>
<a class="btn btn-default">Watch now!</a>
<a class="btn btn-info">Tweet it</a>
</div>
</div>

outside of

nav tags

You do not have to make any changes in CSS