The collapsible toggle menu fails to collapse on mobile-sized screens

I've experimented with basic Bootstrap in order to create a toggle menu, but I'm encountering issues. The menu collapses instead of expanding when the screen size is maximized ('m'). Furthermore, clicking on the toggle icon does not cause it to expand as expected.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ffdf0f0ebecebedfeefdfaab1afb1ad">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"></link>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="54363b3b20272026352414617a647a66">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    <title>Bootstrap</title>
</head>
<body>

        <div class="navbar navbar-expand-lg navbar-dark bg-dark">
            <div class="container">
            <a href="" class="navbar-brand">NinjaXeries</a>
            <button 
            class="navbar-toggler" 
            data-toggle="collapse"
            data-bs-target="#ccs"
            >
            	<span class="navbar-toggler-icon"></span></button>
            <div class="collapse navbar-collapse" id="ccs">

                <ul class="navbar-nav">
                    <li class="nav-item"><a href="" class="nav-link">Home</a></li>
                    <li class="nav-item"><a href="" class="nav-link">Price</a></li>
                    <li class="nav-item"><a href="" class="nav-link">General</a></li>
                    <li class="nav-item"><a href="" class="nav-link">Galle</a></li>
                </ul>
            </div>            
        </div>

    </div>
    
    





   <div class="container mt-3">

    <div class="row">
        <div class="col-12 ">
            <h1 class="text-center">Our Destination</h1>
            <p class="text-center lead">Let's Go</p>
        </div>      
    </div> <!--row-->

    <div class="row">
        <div class="col-12 col-sm-6 col-md-4 col-lg-4 col-xl-2 col-xxl-2">
            <h1 class="text-center">Berlin</h1>
            […]
    </div>

   <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
   <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bedcd1d1cacdcaccdfcefe8a908b89809f868091dcbfcfbfcfecffa2bdadaba2bdafabfdcace">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</body>
</html>

Answer №1

The problem lies with this particular line: data-bs-target="#ccs"

Kindly substitute it with: data-target="#ccs"

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

Some elements in the DOM appear to not be rendering even though they are present in the HTML source code

As a newcomer to web development, I have stumbled upon a perplexing issue. In my usage of d3.js (specifically the script found here), I have been attempting to incorporate additional features. I modified my JavaScript code to include a simple <p> ele ...

How to interact with a button inside a span element without an ID using Selenium

Can anyone help me figure out how to click a button in the browser using Selenium and Python? The button I am trying to click is located within this HTML code: <div id="generate"> <i class="fa fa-bolt"></i> <span>D ...

Header and footer set in place with customizable height paired with a dual-module sidebar

I'm working on a layout that includes a fixed footer and header. My goal is to make the height of the "info-box" div variable, while having the "scrolling-div" fill the remaining vertical space in the right column. The issue arises when setting the he ...

Integrating security with Asp.net Webservices: Using jQuery AJAX to Safely Access the We

What is the most effective method to ensure security when utilizing webservices with Ajax? It is important to protect against unauthorized remote calls outside of the application. Here is an example of a webservice: [WebService(Namespace = "http://tempur ...

Is it possible to modify the CSS injected by an Angular Directive?

Is there a way to override the CSS generated by an Angular directive? Take, for instance, when we apply the sort directive to the material data table. This can result in issues like altering the layout of the column header. Attempting to override the CSS ...

Utilizing tags within the pre tag to incorporate additional styles

Using pre tags to display code works well, but I need to style certain parts of the code in green. However, when I wrap the desired code in a <div> tag with styling, it affects formatting by adding newlines and swallowing spacing. How can I achieve t ...

If the image is not found, deactivate the anchor or hyperlink

I am encountering an issue where I have an image tag within an anchor element setup as shown below: <a href='$image'><img alt='No Image' src='$image'></a> When the image is not available, I can still intera ...

Tips on automatically setting the default value in select2.js dropdown selection

I have integrated the select2.js library to create a dropdown list in my project. I am trying to set the default selected value for the dropdown based on the data obtained from my URL. However, I am unsure of how to achieve this using select.js. In the Ja ...

Dropdown list control allowing multiple selections

Need assistance in creating a multiple select dropdown list in asp.net. The requirement is to have other controls populated based on the selection of an item without using any third-party tools. Looking for suggestions on how to achieve this using JQuery ...

When transmitting data through ajax, escape characters are seamlessly included

I am looking to pass the SQL condition statement using the id of the link element, which represents the category of the product. This information will be processed by a PHP file and then loaded back into the div with the class load_area. To achieve this, I ...

2-panel accordion interface

Hello there, I've encountered a problem that seems to be related to CSS. Here is the project I'm currently working on: My main focus is on the News accordion menu. The goal is to display a small image (50x50 with padding) next to a large headlin ...

Link PayPal payments to the individual making the payment

On my website, I offer in-game features that can be purchased through a miniature store with PayPal buy now buttons. I'm looking for the best and most secure method to automatically deliver these in-game bonuses to users after they have completed thei ...

Problems arising from Jquery append functionality

When using the append method, my inner div is only attaching one WHEAT-COLORED-BOX, whereas when using appendTo, my inner div attaches all the required number of WHEAT-COLORED-BOXES. Therefore, in this case, appendTo gives the correct result while append f ...

I am experiencing issues with my bootstrap file not working despite providing the correct file path. The styles are not being applied on my webpage

The file path is provided below <link rel="stylesheet" href="../css/bootstrap.min.css"> I have exhausted all options in an attempt to resolve the issue. The browser console indicates a 404 error (err_abborted) ...

Prevent duplicate email submissions to the database by utilizing the jQuery validation plugin with AJAX

Hello everyone, I am currently utilizing the jquery validation plugin and it is functioning properly. However, I am encountering an issue where if an email already exists in the database, the form should not be submitted until a different valid email is ch ...

Unable to interpret JSON array

Having a Jquery problem that's giving me trouble with finding a clear solution. $( document ).ready(function() { handleJson(); }); function handleJson(){ $.getJSON("fileList.json", function(json) { $. ...

jQuery fails to recognize the pressing of the "left" key within an input field

Here is my code: $('input').live('keypress', function(event) { if (event.keyCode === 37) console.log("left key pressed"); else console.log("some other key press"); }); For a live demo, please visit http://jsfiddle.net/4RKeV/ A ...

How to install Typed.js without using Node.js

I'm currently working on a project that requires the JavaScript library typed.js, however, I am using the free webhost 000webhost which does not support Node.js. Since typed.js is typically installed using Yarn, NPM, or Bower - all of which require No ...

What is the best way to retrieve the identifier of the checkbox that was recently selected by the user with jQuery?

My asp.net repeater is binding the member id to the checkbox id within a fieldcontain of jquery mobile. <div data-role="fieldcontain" style="margin: 0px"> <fieldset data-role="controlgroup"> <asp:Repeater ID="rpt" runat="server" ...

How to Use Absolute Positioning in Bootstrap 3.0 to Position Child Divs

I have a div block that needs to always be displayed at the bottom of the section, regardless of whether the section above is empty. The inner div should stay at the bottom of the section, as shown in the attached image. This is my current code: <div ...