Issue with using an <a> tag within a <li> element in Bootstrap

When I attempted to include an "a" tag within an "li" element, I noticed that the pointer cursor was missing and the href attribute wasn't functioning as expected. Which Bootstrap property is causing this issue? Could it be a lack of padding for the li tag? Any recommendations on how to enhance this using Bootstrap classes would be greatly appreciated.

body {
  margin: 0;
  padding: 0;
  font-family: "Arial, Helvetica, sans-serif,";
  font-size: 12px;
  font-weight: normal;
}

.header {
  background-color: #222222;
  height: 114px;
}
ul {
  color: white;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  font-family: "MyradProRegular";
  font-size: 14px;
  text-transform: capitalize;
}

.input-group {
  display: flex;
}

.container-fluid {
  height: 100px;
}

.navbar {
  width: 37%;
  margin-bottom: 0 !important;
  min-height: 0px !important;
}

.search-panel-block {
  width: 40%;
}

img {
  max-width: 100%;
}

.menu-items__item {
  list-style-type: none;
}

.search-panel {
  padding-top: 34px;
}
.nofloat {
  float: none;
}
.agileheader-topbar-grid {
  margin-left: auto;
}

.nav > li > a {
  position: static;
  padding: 0;
}

.btn {
  width: 65px;
  background-color: #f10e34;
  border-color: #f10e34;
}

.glyphicon-search {
  color: #ffffff;
}
<!doctype html>
<html lang="en">
<head>
  <title>Hello, world!</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
          integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
          crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"
          integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh"
          crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"
          integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
          crossorigin="anonymous"></script>
</head>
<body>
<header class="header">
  <div class="container-fluid">
    <div class="menu-logo">
      <img src="logo.jpg" alt="market-logo.jpg">
    </div>
    <nav class="navbar navbar default col-lg-9 col-md-9 col-sm-9 pull-right">
      <ul class="menu-items nav">
        <li class="menu-items__item"><a href="#" class="menu-items__link nav-link">My account</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Wishlist</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">My Cart</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Checkout</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Login</a></li>
      </ul>
    </nav>
    <div class="agileheader-topbar">
      <div class="container">
        <div class="col-md-6 agileheader-topbar-grid agileheader-topbar-grid2 nofloat">
          <form class="search-panel">
            <div class="input-group add-on">
              <input class="form-control" name="srch-term" type="text" placeholder="Search">
              <button class="btn btn-default" type="submit">
                <i class="glyphicon glyphicon-search"></i>
              </button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</header>
</body>
</html>

Answer №1

The menu is being overridden by a div with the class "agileheader-topbar". You can fix this issue by using the following code snippet:

<nav class="navbar navbar default col-lg-9 col-md-9 col-sm-9 pull-right" style="z-index: 1;">

Answer №2

Solution:

.navbar {
  z-index: 1;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Arial, Helvetica, sans-serif,";
  font-size: 12px;
  font-weight: normal;
}

.header {
  background-color: #222222;
  height: 114px;
}
ul {
  color: white;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  font-family: "MyradProRegular";
  font-size: 14px;
  text-transform: capitalize;
}

.input-group {
  display: flex;
}

.container-fluid {
  height: 100px;
}

.navbar {
  width: 37%;
  z-index: 1;
  margin-bottom: 0 !important;
  min-height: 0px !important;
}
<!doctype html>
<html lang="en">
<head>
  <title>Greetings from the digital world!</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
          integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
          crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"
          integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh"
          crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"
          integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
          crossorigin="anonymous"></script>
</head>
<body>
<header class="header">
  <div class="container-fluid">
    <div class="menu-logo">
      <img src="logo.jpg" alt="digital-logo.jpg">
    </div>
    <nav class="navbar navbar default col-lg-9 col-md-9 col-sm-9 pull-right">
      <ul class="menu-items nav">
        <li class="menu-items__item"><a href="#" class="menu-items__link nav-link">My profile</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Favorites</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Shopping Cart</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Payment</a></li>
        <li class="menu-items__item nav-link"><a href="#" class="menu-items__link">Sign In</a></li>
      </ul>
    </nav>
    <div class="agileheader-topbar">
      <div class="container">
        <div class="col-md-6 agileheader-topbar-grid agileheader-topbar-grid2 nofloat">
          <form class="search-panel">
            <div class="input-group add-on">
              <input class="form-control" name="srch-term" type="text" placeholder="Search">
              <button class="btn btn-default" type="submit">
                <i class="glyphicon glyphicon-search"></i>
              </button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</header>
</body>
</html>

Answer №3

Place your navigation bar within another div element to ensure that when you hover over a nav item, it appears hovered within a different div element (.agileheader-topbar). You can achieve this by using the following CSS:

.agileheader-topbar { 
   width: 40; /* Adjust as necessary */
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Transferring data from an anchor tag using AngularJS

Within my php website, there is a button with an anchor tag embedded in it that transmits a numerical value to the Angular application; echo "<button data-toggle='tooltip' type='submit' data-placement='bottom' title='$ ...

How come I'm unable to showcase the inventory of items to the customer even though they are saved in the database and visible in the Network tab on the console?

Basically, my goal is to showcase products on the client side. I am using Angular 12 with .NET 5 for the backend. Although I am fetching products from the product's controller, they are not visible to me. However, I can see the "welcome" title and I k ...

HTML: Deconstruct, Analyze, and Revamp for a mobile-friendly site

I am currently working on a project for my computer science class in which we are required to choose an application that interests us and understand how it functions. I decided to focus on the technology provided by dudamobile.com This particular app is d ...

Styling a multilevel list with CSS that includes a combination of

Hello everyone! I am looking to create a mixed multilevel list in CSS, similar to the one shown in this image: image description here. I have attempted the following code snippet, but it seems to apply the counter to unordered lists: ol { counter-res ...

How can I automatically copy a highlighted link in HTML?

I am attempting to implement a feature where users can click on a link and have it automatically copied. For example, I want it to appear like this: "UPI ID: david@okidfcbank". In this case, the link should be highlighted in blue. This is the code I have ...

What would be the most appropriate way to organize the following data structure?

I'm facing a challenge with organizing content on a non-CMS website for the first time. I have about 250 individuals, each with a first name, last name, telephone number, email address, and some additional information. My initial thought was to use a ...

When I type in the TextBox, the CheckBox value should be deactivated if it is unchecked

Whenever I attempt to input text into the textbox associated with my checkbox, the checkbox automatically becomes unchecked. How can I prevent this from happening? <span id="TRAVEL_TYPE_1"><input id="TRAVEL_TYPE_0" type="checkbox" onclick="Update ...

What steps should be taken to transform this object into code?

In the code snippets provided below, I am trying to achieve the design outlined in the image. .stone-item{ width: 330px; transition: all .2s ease-in-out; -webkit-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out; ...

Having difficulty centering an image in HTML?

I've been struggling to get the image (logo) centered on the top bar! I've tried using align-self: center;, display:block;, but nothing seems to work. It feels like I'm missing something here! Click here for the codesandbox link to view the ...

Managing active dropdown menus in VueJS

I'm having trouble figuring out why my navigation menu and method to open subitems on click are not working correctly. [![dropdown_menu][1]][1] new Vue({ el: '#app', data: { //menu "menu_title": "a", "child_ro ...

Enhance Your File Uploads with Custom Images in Bootstrap

For the file upload buttons, I have used the given image by customizing the button look using Bootstrap 3. Here is an example of how I achieved this: <label class="btn btn-primary" for="my-file-selector"> <input id="my-file-selector" type="fi ...

Working with Ext JS: Dynamically adjusting panel size when the browser window is resized

I am facing an issue with a side panel in Ext.js. Everything is working fine until I resize the browser, at which point some components of the panel get cut off. https://i.sstatic.net/eaEGI.png Is there a way to make the panel resize automatically when t ...

Issue with Angular dynamic style not functioning properly in Chrome

I am looking to increment the height of a div by 20px gradually. Why does the code below only function properly in Chrome and not in IE? <div ng-repeat="p in percentage"> <div style="height: {{$index*20+5}}px"></div> </div> ...

Styling the sacred grail layout with organized columns

In my search for answers, I have come across many general responses to this common question. However, none of them address the specific constraints that I am facing with this version. The task at hand is to implement the holy grail layout, but with a key ...

Can you choose the stylesheet.cssRule[] based on a class name or ID?

Currently, I am able to modify the font size by accessing the first style sheet using the following code: document.styleSheets[0].cssRules[0].style.fontSize = "16"; Here is the CSS snippet: h1 {font-size: 12} .someClass {} As the CSS file ...

Tips for adding text dynamically to images on a carousel

The carousel I am using is Elastislide which can be found at http://tympanus.net/Development/Elastislide/index.html. Currently, it displays results inside the carousel after a search, but I am struggling to dynamically add text in order to clarify to use ...

Instructions on toggling button visibility based on dropdown selection?

My goal is to have a button hidden by default, and when I select an option from a dropdown list, the button should appear. Check out the code on JSFIDDLE $(function() { $('#cashbill').change(function() { $('#bill_icon').hide() ...

Styling a dynamically-injected div using an AJAX request (xhrGet)

Hello everyone, currently I am using the code below to fetch updated content after receiving a "push" event from a server. The new content is then used to replace the existing div/content. However, I'm facing an issue where none of my styles from the ...

The div father's width is not fully occupied by col-xl-12

Can you explain why inew2 and inew3 do not have a width of 100% of their parent div? https://i.sstatic.net/a4GEa.jpg html, body{ width: 100%; height: 100%; margin: 0px; padding: 0px; } .ibrands{ height: 120px; background-color: blue; } @media only scre ...

Position the DIVs at the bottom of the TD

I'm having trouble aligning two DIVs within a table TD to the bottom of the table. Despite trying various alignment methods, the left DIV simply won't move. It's crucial for me to design this email responsively, ensuring it still displays co ...