Exercise:
Use a Bootstrap Navbar Class to make the navigation bar black.
Hint
Hint: Use the .navbar-inverse class.
Edit This Code:
See Result »
<!DOCTYPE html> <html lang="en"> <head> <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-default"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="exercise.asp-filename=exercise_navbars2.html#">WebSiteName</a> </div> <div> <ul class="nav navbar-nav"> <li class="active"><a href="exercise.asp-filename=exercise_navbars2.html#">Home</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 1</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 2</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 3</a></li> </ul> </div> </div> </nav> </body> </html>
Result:
Show Answer
Correct Code:
<!DOCTYPE html> <html lang="en"> <head> <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"> <a class="navbar-brand" href="exercise.asp-filename=exercise_navbars2.html#">WebSiteName</a> </div> <div> <ul class="nav navbar-nav"> <li class="active"><a href="exercise.asp-filename=exercise_navbars2.html#">Home</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 1</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 2</a></li> <li><a href="exercise.asp-filename=exercise_navbars2.html#">Page 3</a></li> </ul> </div> </div> </nav> </body> </html>
Correct Result:
Hide Answer
Privacy Policy