Fabio Lanza
Fabio Lanza

Reputation: 175

Bootstrap Content Delivery Network CDN Not Working

Bootstrap is new to me and I have been using the Bootstrap CND that I found on a tutorial online, which works as expected:

    <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.4/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

However, I realized that it is out of date. Therefore, I went to the Bootstrap website and tried to use the newer Boostrap:

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>

The problem is that by the looks of how the website is coming, the newer version is not working.

This is a screenshot of my navbar with the older Bootstrap CDN (works): enter image description here

This is a screenshot of my navbar with the newer Bootstrap CDN (does not work): enter image description here

HTML for navbar:

<nav class="navbar navbar-inverse">
        <div class="container-fluid">

            <div class="navbar-header">
                <!--menu collapse -->
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavBar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>

                <!--logo -->
                <a href="#" class="navbar-brand">Lanza IT Consulting</a>                
            </div>

            <!--menu items -->
            <div class="collapse navbar-collapse" id="mainNavBar">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>

                    <!--dropdown menu -->
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Services <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Cybersecurity</a></li>
                            <li><a href="#">IT Design & Build</a></li>
                            <li><a href="#">IT Operations</a></li>
                        </ul>
                    </li>

                    <!--dropdown menu -->
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">About <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Who we are</a></li>
                            <li><a href="#">Contact us</a></li>
                            <li><a href="#">Feedback</a></li>
                        </ul>
                    </li>

                </ul>


                <!--right align navbar menu item -->
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="http://localhost:8080/masterproject/Login.jsp">Login</a></li>
                </ul>
            </div>

        </div>
    </nav>

Question: Can you please help me to understand if I did anything wrong with the newer CDN?

Thank you a lot

Upvotes: 1

Views: 1298

Answers (1)

Alexander Ingham
Alexander Ingham

Reputation: 195

I can't see anything immediately wrong with your links. So all I have is some thoughts to suggest.

  1. looking here. There's integrity stuff.
  2. have you check that bootstrap is loaded, they change a whole bunch of stuff recently so you may be using a tag that is nolonger support.
  3. In a quest for more information, check your console (F12 in chrome)

Sorry can't be more help and provide an actually answer, hope this help get you a step closer.

Upvotes: 2

Related Questions