Adding items to Bootstrap navbar instead of simply toggling them

I'm having some issues with my Bootstrap 3 navbar. Instead of toggling between the navbar items, it's appending the content data. For example, when I click on ALL and then Pending, the output shows as: abc
xyz

<div class="vendor category-tab shop-details-tab"><!--category-tab-->
            <div class="col-sm-12">
                <ul class="nav nav-tabs">
                    <li><a href="#allOrder" data-toggle="tab">ALL (10)</a></li>
                    <li class="active"><a href="#pending" data-toggle="tab">Pending (5)</a></li>
                    <li ><a href="#delivered" data-toggle="tab">Delivered (5)</a></li>
                    <li ><a href="#Cancelled" data-toggle="tab">Cancelled (5)</a></li>
                </ul>
            </div>
            <div class="tab-content">
                <div class="tab-pane" id="allOrder" >
                    alpha
                </div>

            </div>
            <div class="tab-content">
                <div class="tab-pane fade active in" id="pending" >
                    beta
                </div>

            </div>
        </div><!--/category-tab-->

Answer №1

To enhance the appearance of your list item, consider adding either a "Padding" or "Margin" property.

<!DOCTYPE html>
<html>
<head>
<style>
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

li {
  float: left;
}

li a {
  display:inline-block;
  padding: 18px;
  background-color:grey;
}
</style>
</head>
<body>
<div style="width:100%;background:grey">
<ul>
  <li><a href="#">Home</a></li>
  <li><a href="#">News</a></li>
  <li><a href="#">Contact</a></li>
  <li><a href="#">About</a></li>
</ul>
</div>
</body>
</html>

For the same visual effect, simply switch the padding to margin

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

Menu changes when hovering

I want to create an effect where hovering over the .hoverarea class will toggle the visibility of .sociallink1, .sociallink2, and so on, with a drover effect. However, my code isn't working as expected. Additionally, an extra margin is automatically ...

There seems to be an issue with the HTML link not redirecting properly, as it is directing to www.oldpage.com/http://www

Has anyone experienced a similar issue before? I can't figure out why this is happening. Here's the HTML code I'm using: <a href="www.google.com">www.google.com</a> Despite it appearing correct, when I click on the li ...

When I view the website on a tablet in landscape mode, the navigation bar vanishes

I just finished creating a responsive menu for a website. Here's how it works: when viewing the site on a regular browser with a width less than 768px, the navigation menu items are stacked and hidden. To reveal them, the user needs to click on a tog ...

Eliminate redundant XML entries when using jQuery autocomplete

Does anyone know how to prevent duplicate records from appearing in a jQuery autocomplete dropdown? I am pulling data from an XML file and want to ensure that each record is unique and only displayed once. You can see the issue here ...

"Challenges Arising in Deciphering a Basic JSON Array

After countless attempts, I am still struggling to solve this issue. My PHP code is functioning properly, as it returns the expected data when "Grove Bow" is selected from the dropdown menu: [{"wtype":"Grove Bow","was":"1.55","wcc":"5","wbdmin":"12","wbdm ...

Expand Menu Options (jQuery)

Currently facing a jQuery problem that I can't seem to figure out. I've set up a menu with submenu elements and want to toggle the content height by clicking on menu items. The issue arises when clicking on another item causes the content to coll ...

Error message: Unable to locate the ID attribute of this element using jQuery - resulting in undefined value

Trying to extract the ID and display it with an alert message upon clicking, but it keeps showing "undefined" instead. Can anyone provide some assistance? Here is the important part of the code: HTML: <img src="/pictures/picture.jpg" class="r-gal-photo ...

Enhance the elastic layout to ensure full compatibility with Internet Explorer

My elastic layout functions perfectly in Chrome and other major browsers, except for IE which seems to be ignoring the @media query. http://jsfiddle.net/U2W72/17/embedded/result/ * {margin: 0px; padding 0px'} .thumb { float: left; width:16. ...

Trouble with font sizing in a single line

Here's an interesting problem I encountered: <ol><li> <span>01</span><h4>SOME TEXT</h4> </li></ol> #faq ol li h4 { padding-bottom: 16px; padding-top: 14px; padding-left: 16px; max ...

Encoding and decoding HTML code in ASP.NET

Recently, I encountered an issue with my asp.net mvc application where I needed to submit HTML code in a post request. To handle this, I implemented a custom binder for processing the request. The HTML code that I'm trying to submit is: <div id="c ...

What is the procedure for extracting data from a JSON file within an HTML document?

Hey there, I am currently working on reading data from a json file using ajax. I have created a Video object that consists of Courses objects with titles and URLs. However, when attempting to read the title and URL of HTML as an example, I am not seeing a ...

What could be the reason for the malfunction of my flexbox layout?

I need to create a layout with three divs in a row. The first div should have a fixed width, the second div should expand until it reaches a "max-width", and the third div should take up the remaining space. Everything works fine until the text inside the ...

Connect to content on the current page

I am facing an issue where the linked heading of a section on the same page is getting lost under the fixed navigation bar when scrolling down. This problem seems to only occur on desktop view as it works fine on mobile preview. Here is the code I am curre ...

Visual transformation

When browsing through the product gallery, I have the option to choose a color, series, or side view of the item. Each choice is accompanied by its own picture. By clicking on one of these options, the image source (src) changes dynamically with a fadeIn/f ...

What is the best way to align two spans vertically on either side of a div, in relation to the div itself?

At the current moment, it appears as follows: _______________________________________ | | | ___________ | | | | | | ______ | div | ______ | | |s ...

Issue with showing error message to the user using AJAX

Using AJAX code to manage errors from the backend. Everything is functioning properly, but I want to display the errors individually to the user in a numbered list. Desired Output 1. Please enter a valid phone number 2. Please provide your email address ...

apply a border-radius to the top right corner only without affecting the other sides or background

https://i.sstatic.net/9YIiy.jpg I have been working on creating the top right triangle design shown in the image. However, I encountered an issue where applying border radius seems to affect all sides instead of just one as intended. Despite using border- ...

How can I generate a checkbox in a database with a field that allows for enabling and disabling?

I am looking to design a table that includes questions, checkboxes, and text boxes. All the questions are stored in a database and called through an array. In addition, I want to create disabled textboxes that become enabled when their corresponding checkb ...

Visual button spacing

There is no CSS styling applied to the page. When two image buttons are placed in separate lines of code like this: <asp:ImageButton ID="btnVoteUp" Height="16px" Width="16px" runat="server" ImageUrl="images/thumbs_up.gif" CausesValidation="false" Co ...

Problem with the visibility of the drop-down menu when hovering over it

I am currently developing a ReactJS application using reactstrap. One of the components I have created is a dropdown with submenus nested inside. My goal is to make the submenus appear when hovering over the dropdown, and if there are multiple dropdowns ( ...