What are the steps to enable the tab button feature?

Instead of using the ul and li tags, I have implemented three tabs with buttons. My goal is to automatically make the first button active or change its color to green. Despite using the active class in bootstrap, it does not seem to work as expected. How can I achieve this so that users can easily identify their current location? You can view my code on jsfiddle: https://jsfiddle.net/heuvkro0/5/


    <div class="nav nav-pills mt-4">
        <button class="nav-link active btn btn-sm text-light bg-info font-weight-bold float-left" href="#profile" role="tab" data-toggle="tab">
            <span class="number text-light">1</span> 
            <span class="title text-light font-weight-bold pr-2">Beneficiary Details </span>
        </button>

        <button class="nav-link btn btn-sm text-light bg-info font-weight-bold float-left ml-2" href="#buzz" role="tab" data-toggle="tab">
            <span class="number text-light">2</span> 
            <span class="title text-light font-weight-bold pr-2">Dependent Details </span>
        </button>

        <button class="nav-link btn btn-sm text-light bg-info font-weight-bold float-left ml-2" href="#references" role="tab" data-toggle="tab">
            <span class="number text-light">3</span> 
            <span class="title text-light font-weight-bold pr-2">Complete Details </span>
        </button>
    </div>

Answer №1

If you want to style the active class differently, you can add custom CSS like this:

.nav-link.active {
    background-color: #117a8b !important;
}

Check out the demo on jsfiddle

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

How can I use Beautiful Soup to change the value of a dropdown button to match the selected dropdown

Is there a way to have my BS4 dropdown menu display the selected value in the dropdown toggle button, specifically .dropdown-toggle? A similar question was asked before here, but it pertains to an older version (BS3 Framework) and does not address using t ...

Is it possible to verify the compatibility of certain at-rules in CSS?

I am in search of a counterpart to @supports specifically for at-rules. I desire the ability to execute: @supports (@counter-style) { things } My goal is to achieve this using only CSS/HTML. Can anyone guide me on how to accomplish this task? ...

Experiencing problems with CSS and other scripts failing to load following navigation with nodeJs

Currently, I'm trying to extract data from a MongoDb database and then proceed to view, modify, and delete it. The process of extracting the data is going smoothly, however, I am encountering difficulties with editing. To address this issue, I created ...

Convert your Vue.js NativeScript Firebase web app into an Android/iOS mobile application

Just dipping my toes into the world of NativeScript, Vue.js, and Firebase. I successfully created a web app with Vue.js and Firebase, but now I'm unsure about integrating the code into NativeScript while keeping Vue.js code intact. Is it possible to ...

Unable to modify the date input format in Angular when utilizing the input type date

I am currently working with angular 10 and bootstrap 4. I am trying to update the date format in an input field from (dd/mm/yyyy) to DD/MM/YYYY, but I am facing issues. Below is my angular code: <input type="date" id="controlKey" cl ...

Issues with font face rendering on Android Chrome and Firefox devices

I'm currently encountering an issue with the font face in CSS3. The code I have been using is as follows: @font-face { font-family: James Fajardo; src: url('https://www.twoseven.nl/kurkorganicwines/wp- content/themes/kurk/fonts/James_Fajardo.t ...

Add and alter a script tag within the Vue template

I am currently working on integrating a payment service into my platform. The payment service has provided me with a form that includes a script tag. This question is a follow-up to a previous query on inserting a script tag inside a Vue template. Here i ...

What are some techniques to ensure that my "display: grid" layout adjusts properly on mobile devices and tablets by implementing media queries?

Responsive Grid Design I am looking to transform my grid desktop view into a responsive layout for mobile and tablets using media queries in CSS. While it looks great on desktop, it does not adjust well on smaller screens. .grid-container { display: gr ...

Personalize scrollbar appearance in Mozilla Firefox and Internet Explorer

When it comes to customizing the scrollbar in chrome, CSS makes it easy: ::-webkit-scrollbar { width: 7px; } Unfortunately, this method does not have the same result in Firefox (version 38) and IE (version 11). I attempted the following code as an alter ...

Vue: Solving the issue of passing links to components

Why isn't this working as expected? Child Component: <template> <button class="btn" @click="router.push('{{link}}')">{{ text }}</button> </template> <script setup lang="ts"> i ...

The image is being loaded onto the canvas and is being resized

Currently, I am facing an issue with loading images into a canvas element as the image seems to be scaled in some way. To provide some context, I have multiple canvases on my webpage and I want to load images into them. Since the dimensions of the canvas ...

Is it possible to turn off GPU rasterization for a particular SVG element in Google Chrome?

There is a peculiar issue with the SVG graphic displayed on my webpage. On some computers, the complex linearGradient filling a Rect does not display all the Stops correctly, while on other computers it appears fine. I discovered that if I disable "GPU ra ...

Having trouble getting the CSS footer from cssstickyfooter.com to function properly

I tried implementing some basic CSS from to create a sticky footer that remains at the bottom of the page regardless of content length. However, I am encountering a problem with the footer not behaving as expected. There are actually two issues with the f ...

Unable to send POST request (including data) using event trigger from an external component

I'm currently facing an issue where a click event in one component is triggering a method in another, but the data that should be passed in my POST request isn't being sent. Interestingly, when I test the functionality by calling the method dire ...

Tips for showcasing a complete background image in a div even if the content inside is minimal

Check out the header image on ink.talentosoft.com if you get a chance. The height of the header image is precisely 388 px. I am looking to have the background of this div fully displayed. Currently, the setup for the div looks like this: background: url ...

Using Vue.js to set a mobile browser's viewport height to 100%

My webpage has a min-height: 100vh property which causes some overflow on the bottom when rendered on mobile browsers. To fix this issue, I am using the following script: methods: { calcVH() { const vH = Math.max(document.documentElement.clien ...

Error TS2307: Module './tables.module.css' or its type declarations could not be located

Currently utilizing CSS modules within a create-react-app project and encountering an error within Google Chrome browser: https://i.stack.imgur.com/0ItNM.png However, the error appears to be related to eslint because I am able to close the warning modal i ...

How can I resolve the issue with the HTML/CSS footer not functioning properly on Safari for iPhone in my mobile site?

Struggling with a mobile website issue here. The client wants text-based buttons/links at the bottom, so I added them in, but my skills with size percentages are a bit rusty. I need these buttons to line up horizontally and adjust their width accordingly ...

Is it feasible to preserve the HTML form content data even after refreshing the page?

Can someone offer a suggestion that doesn't involve using Ajax? I'm wondering if there is a way to achieve this using JavaScript/jQuery or some other method. Here's my issue: When submitting a page, the action class redirects back to the sa ...

Steer clear of posting additional content that might bump the existing content further up

How can I keep the search bar centered on the screen, even when content is added below it? Here's a screenshot illustrating the issue: https://i.stack.imgur.com/7pQ1q.png The text in the image is causing the search bar to move up, but I want the sea ...