johndoee's avatar

Why bootstrap compile file not work

I download bootstrap 5 compile css js files and use them. the problem is they are not working .

<!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">
    <title>Document</title>
   
    <link rel="stylesheet" type="text/css" href="asset/css/bootstrap.min.css">
    
</head>
<body>
    <nav class="navbar navbar-expand-lg bg-light">
        <div class="container">
          <a class="navbar-brand" href="#">MY WEB</a>

          <button class="navbar-toggler mx-2" type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
         </div>
        
         <div class="btn-group  mx-3">
          
            <button type="button" class="btn btn-secondary dropdown-toggle " data-bs-toggle="dropdown" aria-expanded="false">
              MgMg
            </button>
            <ul class="dropdown-menu dropdown-menu-end w-6 p-2">
              <li><button class="dropdown-item text-center" type="button">Profile</button></li>
              <li><button class="dropdown-item text-center" type="button">Setting</button></li>
              <li><button class="dropdown-item text-center" type="button">LogOut</button></li>
            </ul>
          </div>
       
      </nav>
    
        
<div class="container-fluid">
    <div class="row">
        
        <nav id="sidebar" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
              
              
<div class="position-sticky pt-md-5">
    <ul class="nav flex-column">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="#">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
            <span class="ml-2">Dashboard</span>
          </a>
        </li>
       
    
      </ul>
  </div>
       
        </nav>
        <main class="col-md-9 ml-sm-auto col-lg-10 px-md-4 py-4">
            <h1 class="h2">Dashboard</h1>
        </main>
    </div>
  </div>
 

    <script src="asset/js/popper.min.js"></script>
    <script src="asset/js/bootstrap.min.js"></script>
    <script src="asset/js/bootstrap.bundle.min.js"></script>
</body>
</html>

I have one dropdwon and one toggle button , both not working . Why ?

0 likes
4 replies
RileyGWeb's avatar

Have you ensured that the file path you are referencing is correct? That's the only thing I can think of. I would also try inspecting the buttons to see if the CSS classes are either completely absent, or are just being overridden by something.

Lara_Love's avatar
Level 6

Your address is definitely wrong. After clearing the cache. Check and try again. you can use

src="{{ asset('asset/css/bootstrap.min.css')}}"
src="{{ asset('asset/js/popper.min.js')}}"
src="{{ asset('asset/js/bootstrap.min.js')}}"
src="{{ asset('asset/js/bootstrap.bundle.min.js')}}"
1 like
Lumethys's avatar

@zwarkyaw then why are you not stating that in your post? We cannot magically know what you are using

Please or to participate in this conversation.