Search code examples
htmlclassbootstrap-4nav

Please could somebody explain why my Bootstrap doesn't apply?


I am trying to build my first webpage with Bootstrap, but the Bootstrap code I have added appears to be half responsive (e.g. the navbar seems to know it's been provided some kind of Bootstrap class, but other classes such as navbar-dark do nothing). I have also had to remove the bullet points from my ul myself even though the tutorial I'm following hasn't. I feel as though my issue is how Bootstrap is linked to my HTML file, but remain stumped. Thank you in advance. Here is my code...

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>White Rose Crew Company Website</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
        <link href="./recources/css/index.css" type="text/css" rel="stylesheet">
    </head>
    <body>
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="#aboutUs">ABOUT US</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#ourWork">OUR WORK</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#theCrew">THE CREW</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#contactUs">CONTACT US</a>
                </li>
            </ul>
        </nav>
      
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
        </main>
    </body>
</html>

Solution

  • You're using an old version of Bootstrap. change the version to 4.4 to make this work