I'm having trouble with setting the background color on the jumbotron class and the text color in the navbar. It works when I change from class to id, but I don't understand why it won't work when I use class (notice that background-color works in navbar, but not the color). I worked when I used inline styling, but I want to style it in CSS. It is usually no problem to add or change background color, but I'm new to Bootstrap, so maybe there is some limitations in css when using this that I don't know about or something I have missed?
h1{
text-align: center;
}
p{
text-align: center;
}
.navbar{
background-color: #d9b38c;
color: white; /*this doesn't work*/
}
.jumbotron{
background-color: #cccc99; /*this won't work either*/
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>Hytte til leie</title>
</head>
<body>
<div class="jumbotron">
<h1> LEI DIN DRØMMEHYTTE </h1>
<p> Vi finner hytten som passer perfekt til deg </p>
</div>
<nav class="navbar">
<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="#">DinHytteDrøm</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Hjem</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Våre hytter <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Fjellhytter</a></li>
<li><a href="#">Skogshytter</a></li>
<li><a href="#">Sjøhytter</a></li>
</ul>
</li>
<li><a href="#">Informasjon</a></li>
<li><a href="#">Kontakt oss</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Lag bruker </a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Logg inn </a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<h3>Collapsible Navbar</h3>
<p>In this example, the navigation bar is hidden on small screens and replaced by a button in the top right corner (try to re-size this window).
<p>Only when the button is clicked, the navigation bar will be displayed.</p>
</div>
</body>
</html>