title: Hover issue in navbar with Bootstrap 4
body: <p>I have created a <code>navbar</code> with Bootstrap 4. When I click on a drop-down menu link, it opens and remains open — when I hover on another drop-down link, they overlap.</p>
  
  <p>I want it such that a dropdown link will be closed if I hover on another dropdown link.</p>
  
  <p>Here is the code of my <code>navbar</code> drop-down:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.dropdown:hover&gt;.dropdown-menu {
      display: block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
     &lt;head&gt;
        &lt;title&gt;
           Welcome - Maqbool Solutions
        &lt;/title&gt;
        &lt;link rel="shortcut icon" href="../images/favion_Y13_5.ico" type="image/x-icon"&gt;
        &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous"&gt;
        &lt;script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"&gt;&lt;/script&gt;
        &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"&gt;&lt;/script&gt;
        &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"&gt;&lt;/script&gt;
        &lt;script src="../../js/function.js"&gt;&lt;/script&gt;
        &lt;link rel="stylesheet" href="css/main.css"&gt;
        &lt;link rel="stylesheet" href="css/style.css"&gt;
        &lt;link rel="stylesheet" href="font/css/font-awesome.css"&gt;
     &lt;/head&gt;
     &lt;body&gt;
        &lt;div class="container-fluid"&gt;
           &lt;!--main container--&gt;
           &lt;!-- navbar--&gt;
           &lt;nav class="navbar navbar-expand-lg navbar-custom fixed-top" id="navbar" style=" height: 80px;"&gt;
              &lt;div id="logo"&gt;
                 &lt;a href="index.html"&gt;
                    &lt;h3 class="logo_text"&gt;Maqbool Solutions&lt;/h3&gt;
                 &lt;/a&gt;
              &lt;/div&gt;
              &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
              &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
              &lt;/button&gt;
              &lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&gt;
                 &lt;ul class="navbar-nav ml-auto" id="ul"&gt;
                    &lt;li class="nav-item " align="center"&gt;
                       &lt;i class="fa fa-home " aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link" href="index.html"&gt;Home &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item dropdown" align="center"&gt;
                       &lt;i class="fa fa-cubes" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
                       Products
                       &lt;/a&gt;
                       &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                          &lt;a class="dropdown-item" href="products/ims/ims.html"&gt;Institute Managment Systems&lt;/a&gt;
                          &lt;a class="dropdown-item" href="products/pnms/pnms.html"&gt;Pension Managment Systems&lt;/a&gt;
                          &lt;a class="dropdown-item" href="products/pms/pms.html"&gt;Property Managment Systems&lt;/a&gt;
                          &lt;a class="dropdown-item" href="products/labms/labms.html"&gt;Laboratory Managment Systems&lt;/a&gt;
                          &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                          &lt;a class="dropdown-item" href="products/apps/apps.html"&gt;Apps&lt;/a&gt;
                       &lt;/div&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item dropdown" align="center"&gt;
                       &lt;i class="fa fa-cogs" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
                       Services
                       &lt;/a&gt;
                       &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                          &lt;a class="dropdown-item" href="services/skill_service.html"&gt;Training and Skills&lt;/a&gt;
                          &lt;a class="dropdown-item" href="services/indestrial_services.html"&gt;Industry Expertise&lt;/a&gt;
                          &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                          &lt;a class="dropdown-item" href="services/web_service.html"&gt;Web services&lt;/a&gt;
                          &lt;a class="dropdown-item" href="services/software_service.html"&gt;Software services&lt;/a&gt;
                          &lt;a class="dropdown-item" href="services/animation_service.html"&gt;Animation services&lt;/a&gt;
                          &lt;a class="dropdown-item" href="services/graphic_service.html"&gt;Graphic services&lt;/a&gt;
                          &lt;a class="dropdown-item" href="services/game_service.html"&gt;Game services&lt;/a&gt;
                          &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                          &lt;a class="dropdown-item" href="services/apps_service.html"&gt;App services&lt;/a&gt;
                       &lt;/div&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item dropdown" align="center"&gt;
                       &lt;i class="fa fa-pencil-square-o" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
                       Training
                       &lt;/a&gt;
                       &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                          &lt;a class="dropdown-item" href="training/soft.html"&gt;Software Designing &amp; Development&lt;/a&gt;
                          &lt;a class="dropdown-item" href="training/design.html"&gt;Designing &amp; Composing&lt;/a&gt;
                          &lt;a class="dropdown-item" href="training/web.html"&gt;Web Designing &amp; Development&lt;/a&gt;
                          &lt;a class="dropdown-item" href="training/animation.html"&gt;2D&amp;3D Animation &amp; Development &lt;/a&gt;
                          &lt;a class="dropdown-item" href="training/game.html"&gt;Game Development &lt;/a&gt;
                          &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                          &lt;a class="dropdown-item" href="training/app.html"&gt;App Development &lt;/a&gt;
                       &lt;/div&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item dropdown" align="center"&gt;
                       &lt;i class="fa fa-briefcase" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
                       About Us
                       &lt;/a&gt;
                       &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                          &lt;a class="dropdown-item" href="aboutus/hwr.html"&gt;Who we are&lt;/a&gt;
                          &lt;a class="dropdown-item" href="aboutus/our_vision.html"&gt;Our vision&lt;/a&gt;
                          &lt;a class="dropdown-item" href="aboutus/our_team.html"&gt;Our Team&lt;/a&gt;
                          &lt;a class="dropdown-item" href="aboutus/policy.html"&gt;Privacy &amp; Policy&lt;/a&gt;
                       &lt;/div&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item dropdown" align="center"&gt;
                       &lt;i class="fa fa-graduation-cap" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
                       Career
                       &lt;/a&gt;
                       &lt;div class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                          &lt;a class="dropdown-item" href="career/jobs.html"&gt;Jobs&lt;/a&gt;
                          &lt;a class="dropdown-item" href="career/inter.html"&gt;Internship&lt;/a&gt;
                          &lt;a class="dropdown-item" href="career/hiring.html"&gt;Our Hirring process&lt;/a&gt;
                       &lt;/div&gt;
                    &lt;/li&gt;
                    &lt;li class="nav-item" align="center"&gt;
                       &lt;i class="fa fa-pencil" aria-hidden="true"&gt;&lt;/i&gt;
                       &lt;a class="nav-link" href="contect_us.html"&gt;Contact Us&lt;/a&gt;
                    &lt;/li&gt;
                 &lt;/ul&gt;
              &lt;/div&gt;
              &lt;hr class="col-md-12 nav_hr"&gt;
           &lt;/nav&gt;
           &lt;!--end of navbar--&gt;
        &lt;/div&gt;
     &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>