Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,894 questions

51,825 answers

573 users

How to create top navbar with logo and collapsible icon in Bootstrap 4

1 Answer

0 votes
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <!-- scale=1 for mobile website -->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Bootstrap 4</title>
    <link
      rel="stylesheet"
      href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
    />
  </head>

  <body>
    <!-- Navigation -->
    <!-- Medium (md) for devices like tablets, 768px and up -->
    <nav class="navbar navbar-expand-md navbar-light bg-light sticky-top">
      <!-- container-fluid for 100% of the screen -->
      <div class="container-fluid">
        <a class="navbar-brand" href="#"><img src="img/yourlogo.png" /></a>
        <!-- Collapsible icon (button) that is visible only when the screen is small -->
        <button class="navbar-toggler" type="button" data-toggle="collapse">
          <span class="navbar-toggler-icon"></span>
        </button>
      </div>
    </nav>

  </body>
</html>

 



answered Apr 4, 2020 by avibootz
edited Apr 4, 2020 by avibootz
...