How to Fix a Non-Functional Navbar Toggler in Bootstrap 4

I'm currently practicing my skills in Bootstrap 4 by rebuilding my website with it. However, I've run into an issue with the responsive navigation bar's toggler not working properly. Can anyone provide guidance on how to fix this? Thank you!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Christian | First Website</title>
    <link rel="stylesheet" href="assets/css/bootstrap.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="alternate stylesheet" href="/assets/css/font-awesome.min.css">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-light navbar-toggleable-md">
  <a class="navbar-brand" href="#"><img src="assets/images/logo.png" height="100px"></a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav ml-auto">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home<span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">About</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Work</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Contact</a>
      </li>
    </ul>
  </div>
</nav>
</body>
</html>

Answer №1

Make sure to check out http://getbootstrap.com/docs/4.0/getting-started/introduction/ It appears that not all the necessary bootstrap files are linked at the bottom of the page before the closing tag.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ways to retrieve the input fill value

I'm trying to pass the value of an input field from one function to another, but I'm unsure of how to do it. The first function, input fill: $("#buttonDone4").click(function () { function productAddToTable() { ...

Using CSS Grid to position components in specific regions

Take a look at my HTML code: <div> <div id="navbar" class="box">Navbar</div> <div id="sidenav " class="box">Side Navbar</div> <div id="main " class="box"> ...

How can JavaScript be used to activate HTML5 AppCache?

<html manifest="example.appcache"> Is it possible to use javascript to include the manifest="example.appcache" part? ...

Utilize JavaScript to transform today's date into a Martian date

I am trying to convert the current date on Earth to the current date on Mars using the Earth Date to Martian Solar Longitude Converter available here. The code appears to calculate the Mars date correctly, but I seem to be missing something. If anyone can ...

I am looking to showcase a series of icons linked together by connecting lines

I have successfully designed the layout and added icons, but I am facing difficulty in creating connecting lines between them. I attempted to utilize CSS borders and pseudo-elements, yet I cannot achieve the desired outcome. If anyone could offer a CSS-ba ...

conceal menu upon click (gradually disappear)

This is a basic HTML/CSS menu. Currently, it is functioning properly for page redirection (href). However, I would like it to hide after being clicked on. I plan to call a function that will initiate an AJAX request upon clicking. Here is the code on JS ...

Utilizing JQuery to show just 2 decimal points in a display

How can I limit the display to only 2 decimal places? Here is my code snippet: $("#nlots, #prlot").keyup(function() { $("#quotation").val($("#prlot").val() * $("#nlots").val()); }); ...

The Cycle2 pager feature eliminates the ability to control Youtube video playback

I am currently utilizing the Cycle2 slideshow plugin (http://jquery.malsup.com/cycle2/) to showcase images on my website. However, I've encountered an issue where the CSS from Cycle2 interferes with the controls of YouTube videos when displayed togeth ...

Animate the width of a div element with CSS from the center

I'm working on a cool menu animation as a little experiment. Here's what I've got so far: HTML <div class="menu"> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> < ...

What is the process for extracting the sessionId and viewstate variables from this code?

This Question Might Have Been Asked Before: Find the HREF Attribute of an A Element I'm struggling with extracting the sessionId and viewstate variables from this piece of code. Can someone assist me? The code snippet in question is as follows: ...

What is the best way to bridge the distance between a shrunken iframe and the following element?

https://i.sstatic.net/AZ7T4.png My iframe was resized to 65%, but the containing "div" still occupies the original iframe size, creating a large gap between the iframe and the next element. I'm not sure how to remove this gap. I want the next element ...

Arranging three elements in a CSS grid for perfect alignment

I started with 3 elements and thought about making them adaptive by using css grid. <div class="elements-wrapper"> <div class="element-1"></div> <div class="element-2"></div> <div class="element-2"></div> ...

Revise the color of the selected image

click here for image description I'd like the area's color to change when the mouse hovers over it. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA ...

Various borders within a single div

Having trouble creating a div with different borders using CSS. I want a card with solid borders on the left, top, and right sides, but a specific border image at the bottom. I can get either the image or the solid borders, but not both simultaneously. W ...

jQuery - Comparing Nested and Unnested Transition and Animation Event Handlers/Listeners

At the moment, I am working on a block of code that triggers every time a specific ajax call is made. The snippet I'm using looks like this (although it might throw an error due to absence of html or css - but that's not my concern as I just wan ...

Encountering a crash when trying to display HTML text in UITextView in Swift 4?

Recently, I implemented this code snippet: https://i.sstatic.net/fYCXQ.png var htmlToAttributedString: NSAttributedString? { guard let data = data(using: .utf8) else { return NSAttributedString() } do { return try NSAttributedString(data: ...

Unable to disable background color for droppable element

For my project, I am working with two div boxes. My goal is to make it so that when I drag and drop box002 into another div box001, the background color of box001 should change to none. I have attempted to achieve this functionality using jQuery without s ...

The width of the Div element is not following the specified dimensions, and it also has an unspecified margin

Check out my code snippet at: http://jsfiddle.net/8z4aw/ I'm trying to create a table-like layout using div elements, but for some reason the browser is not respecting the specified widths and seems to be adding an unwanted right margin. Where is thi ...

Chrome and Firefox browsers are not supporting HTML simple anchor links

Creating a portfolio page at this link (http://198.96.94.51/v2/) and encountering an issue with the navigationMenu. When rapidly clicking on the links on the side, they do not redirect to the correct anchor point (some don't move the page at all). I h ...

Unlocking the API endpoints within nested arrays in a React project

{ [ "quicktype_id": 1, "quicktype": "Laptops", "qucik_details": [ { "type_name": "car", "type_img": "car_img" }, { "type_name": "van", "type_img": ...