Advertisement
fcamuso

Bootstrap - lezione 5

Jul 12th, 2023
1,323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.79 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3.  
  4. <head>
  5.   <title>Title</title>
  6.   <!-- Required meta tags -->
  7.   <meta charset="utf-8">
  8.   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9.  
  10.   <!-- Bootstrap CSS v5.3.0 -->
  11.   <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"
  12.        integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM"
  13.        crossorigin="anonymous">
  14. </head>
  15.  
  16. <body>
  17.  
  18.   <nav class="navbar navbar-expand-lg text-bg-warning" >
  19.        
  20.     <button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navBar">
  21.       <span class="navbar-toggler-icon"></span>
  22.     </button>
  23.  
  24.     <div class="collapse navbar-collapse" id="navBar">
  25.        <ul class="navbar-nav">
  26.         <li class="nav-item"> <a href="#" class="nav-link">Home</a>  </li>
  27.         <li class="nav-item"> <a href="#" class="nav-link">File</a>         </li>
  28.         <li class="nav-item"> <a href="yt_05_menu.html" class="nav-link">Modifica</a>     </li>
  29.         <li class="nav-item"> <a href="#" class="nav-link">Strumenti</a>    </li>
  30.         <li class="nav-item"> <a href="#" class="nav-link">Contatti</a>     </li>
  31.       </ul>              
  32.     </div>
  33.  
  34.   </nav>
  35.  
  36.  
  37.   <!-- Bootstrap JavaScript Libraries -->
  38.   <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
  39.          integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"
  40.          crossorigin="anonymous"></script>
  41.  
  42.   <script>
  43.    
  44.     const pagina = document.URL.substring(document.URL.lastIndexOf('/')+1);
  45.     const link_da_attivare = document.querySelector("a[href='"+pagina+"']");
  46.     link_da_attivare.classList.add("active");
  47.  
  48.   </script
  49.  
  50. </body>
  51.  
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement