Template Navbar Moderne – Design Élégant et Responsive

Template Navbar Moderne – Design Élégant et Responsive
×

CSS

HTML

<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Navbar Moderne</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
  <style>
    /* Style du navbar */
    .navbar {
      background-color: darkviolet;
      border-radius: 10px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      padding: 10px 20px;
    }

    /* Logo */
    .navbar-brand img {
      max-width: 40px;
    }

    /* Liens du menu au centre */
    .navbar-nav .nav-item .nav-link {
      background-color: white;
      border-radius: 30px;
      padding: 10px 20px;
      color: darkviolet;
      font-weight: bold;
      margin: 0 5px;
      transition: all 0.3s ease;
    }

    /* Hover sur les liens */
    .navbar-nav .nav-item .nav-link:hover {
      background-color: darkviolet;
      color: white;
      transform: scale(1.05);
    }

    /* Section des icônes à droite */
    .navbar-nav .nav-item .btn {
      background-color: transparent;
      border: none;
      color: white;
      font-size: 18px;
      margin-left: 10px;
      transition: all 0.3s ease;
    }

    .navbar-nav .nav-item .btn:hover {
      color: darkviolet;
      transform: scale(1.1);
    }

    /* Style du bouton collapse */
    .navbar-toggler-icon {
      background-color: white;
      border-radius: 50%;
      transition: transform 0.3s ease;
    }

    .collapsed .navbar-toggler-icon {
      transform: rotate(180deg);
    }

    /* Animation de transition au toggle */
    .navbar-toggler {
      border: none;
    }

    /* Liens des boutons à droite */
    .d-flex {
      align-items: center;
    }

    /* Style des liens dans le menu déroulant en mobile */
    .navbar-collapse {
      text-align: center;
    }
  </style>
</head>
<body>

  <!-- Navbar -->
  <nav class="navbar navbar-expand-lg">
    <div class="container-fluid">
      <!-- Logo à gauche -->
      <a class="navbar-brand" href="#">
        <img src="https://bamibami.com/img/image-removebg-preview%20(1).png" alt="Logo">
      </a>
      
      <!-- Bouton collapse -->
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      
      <!-- Liens de navigation -->
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav mx-auto">
          <li class="nav-item">
            <a class="nav-link active" href="#">Lien 1</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Lien 2</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Lien 3</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Lien 4</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Lien 5</a>
          </li>
        </ul>
        
        <!-- Icons à droite -->
        <div class="d-flex align-items-center">
          <button class="btn btn-light">
            <i class="fas fa-globe"></i> <!-- Icone des langues -->
          </button>
          <button class="btn btn-light">
            <i class="fas fa-user"></i> <!-- Icone utilisateur -->
          </button>
          <button class="btn btn-light">
            <i class="fas fa-sun"></i> <!-- Icone mode clair -->
          </button>
        </div>
      </div>
    </div>
  </nav>

  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"></script>
</body>
</html>