Why don't bootstrap codes run on my django website?

Question:

Hello

I’m having trouble applying bootstrap to my website in django.

I copied the bootstrap link in the html page and wrote the navbar codes in the body part, but when I hit runserver, the website page doesn’t change at all!

where is the problem from?
I also installed the bootstrap plugin in Visual studio code, but it still doesn’t change anything!

Thank you for your guidance

<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF -8">
    <title> {% block title %} {% endblock %} </title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">

</head>
<body>

    <nav class="navbar navbar-expand-lg navbar-dark big-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="#">Navbar</a>
        </div>
    </nav>

    {% block content %} {% endblock %}
</body>
</html>

Asked By: Kve

||

Answers:

Bootstrap seems to be working for me. You might not be seeing your navbar on the screen because you have a white background and you’re using navbar-dark.

<body style="background: red">
    <nav class="navbar navbar-expand-lg navbar-dark big-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="#">Navbar</a>
        </div>
    </nav>
    ...

Jsfiddle: https://jsfiddle.net/mov0wjsq/23/

As you can see, the navbar’s text is white which is why it wasn’t showing up.

Answered By: Bernard Borg
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.