Modify the button outline while the navigation tabs are active

I have implemented nav-tabs within a bootstrap panel.

When the first button is active on the panel header, the border appears thicker on the left side and top.

Query: How can I ensure that there is no double thickness in the border for whichever button is active?

JSFiddle Example

https://i.sstatic.net/yj4um.png

.panel.with-nav-tabs .panel-heading {
    padding: 5px 5px 0 5px;
}
.panel.with-nav-tabs .nav-tabs{
    border-bottom: none;
}

.panel.with-nav-tabs .nav-justified{
    margin-bottom: -1px;
}

.panel.with-nav-tabs .panel-heading {
    background-color: #fafbfc;
    border-bottom: 1px solid #e1e4e8;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    padding-left: 0;
    padding-top: 0;
}

.panel.with-nav-tabs .nav-tabs > li > a {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}

.nav-tabs > li.active > a, 
.nav-tabs > li.active > a:hover, 
.nav-tabs > li.active > a:focus {

}

HTML

<div class="panel with-nav-tabs panel-default">
    <div class="panel-heading">
    <ul class="nav nav-tabs">
    <li class="active"><a href="#tab1default" data-toggle="tab">Default 1</a></li>
    <li><a href="#tab2default" data-toggle="tab">Default 2</a></li>
    </ul>
    </div>
    <div class="panel-body">
    <div class="tab-content">
    <div class="tab-pane fade in active" id="tab1default">Default 1</div>
    <div class="tab-pane fade" id="tab2default">Default 2</div>
    </div>
    </div>
</div>

Answer №1

To correct the border display issue on the panel heading and tabs, you should disable the borders on the individual tabs specifically:

/* Remove top border from all tabs */
.panel.with-nav-tabs .nav-tabs > li > a {
   border-top: none;
}

/* The first tab does not need an additional left border */
.panel.with-nav-tabs .nav-tabs > li:first-of-type > a {
   border-left: none;
}

For a practical demonstration, view this fiddle.

If your panel extends to the right with multiple tabs, consider adding a rule for the "last-of-type" tab to remove the right border as well.

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

Using Inline Styling to Showcase a Background Image in a REACTJS Component

import React from 'react'; import Slick from 'react-slick'; import style from './Slider.module.css'; import {Link} from 'react-router-dom'; const SliderTemplates = (props) => { let template = null; const ...

"Cascading Style Sheets for Organizing Buttons in a Grid

I have created a layout in Word that I want to achieve: https://i.stack.imgur.com/krK7w.png After researching, I found out about the CSS grid layout which seems like the best option for achieving the desired layout. However, when implementing the grid i ...

Yeoman webapp error: Issue with incorrect CSS path in subfolder

I have been using the yeoman webapp generator (0.5.0) and my app directory is structured like this: app/ ├── dir1 │ └── index.html ├── favicon.ico ├── images ├── index.html ├── robots.txt ├── scripts │ └ ...

Creating a variable with the use of @include

Here's a question that I need help with. I have a SASS @include function that dynamically calculates the font size. h2 { @include rfs(2rem); } I use this to adjust the font size based on screen resolution, but I'm facing an issue where a gre ...

Text with background coloring only

My text background always extends beyond the screen. Can anyone help me figure out what I'm doing wrong? Here is the HTML code: <div class="textSlide"> <span id="firstTitle">We assist you in finding all the individu ...

ajax is not functioning properly on scrolling div

I recently created a 1 on 1 support chat using ajax and it's been working well. However, I've encountered an issue where the div expands indefinitely when refreshed by ajax and is taller than its original height. I've tried using overflow: a ...

Having trouble aligning items (3) in the center on top of other elements (3) using flexbox

Currently, I am working on developing a community blog/website called THPSBlog. Utilizing the FlexBox feature, I divided and designed a banner with three distinct sections. NEWS | MEDIA | COMMUNITY The banner consists of three i ...

Creating sleek flat buttons using WebixWould you like to learn how to

From what I've observed, the default buttons in webix appear a certain way. In a demo, I noticed "flat" type buttons that look different: Is there a way to customize my navigation buttons to look like that? I couldn't find any information about ...

CSS animations are failing to work properly in Firefox due to a pseudo-element issue

I'm encountering a problem with my CSS animations in Firefox. Specifically, the animations are not working on a pseudo element (:after) while they work perfectly fine on other browsers. Below is where the animations are being applied: :after { d ...

How to create a transparent background image in a Jekyll theme without impacting the visibility of the foreground

I'm new to HTML and CSS, currently working with a Jekyll boostrap landing theme from GitHub to create a static responsive website. I'm looking to change the background image on the theme and make it transparent to enhance the visibility of the fo ...

Issue with Material Design Lite input floating label not functioning properly post page navigation

I am currently developing a mobile hybrid application using Material Design Lite, but I have run into a small issue. When I add input field elements to my pages, the floating text and placeholder do not function properly. In my application, I am utilizing ...

Looping through color transitions upon hover using CSS

I am trying to create a color transition effect on hover, where the background changes from yellow to red and then back to yellow in a loop. I'm having trouble figuring out how to make this transition repeat continuously. Do I need to incorporate Java ...

Difficulty arranging objects in both horizontal and vertical orientation within a single flexbox container

I'm struggling with aligning my bootstrap flexbox container properly. I want the image to remain horizontal on the left, while the title, description, and "powered by" sections stack vertically to its right. So far, all my attempts to achieve this hav ...

What causes the unset width or height to impact object-fit, and is there a workaround for this issue?

Query Beginnings Encountering unexpected behavior while using the value unset with the rule object-fit led me to question if there might be a rationale or workaround for this peculiar issue. Demonstration .block { &__img { width: 100%; hei ...

Is there a way to transform the input with the file type into an icon in React using JavaScript? Additionally, I would like to know how to

I'm trying to find a way to replace the input type=file with an icon and get rid of the path preview. Can anyone help with changing the styling for this? Right now, clicking on the button shows a preview of the selected file. I then display the uploa ...

How can I use CSS to clip the United States, specifically Tennessee and Nashville, from the left side?

For my ASP.NET generated hyperlink that says "select location", when the user clicks on it, they are redirected to a new page where they can choose a different location at /change-location/default.aspx. This could be any country, state, or city in the worl ...

Achieving Bottom or Center Alignment for a Div within Another Div Using Bootstrap 5

I've been struggling to position my Title and CTA Button at the bottom (or center) of the main image div. I'm using Bootstrap 5.1 and have tried various d-flex methods without success. You can view my code on jsfiddle. Thank you in advance for a ...

What is the best way to animate various sprites using distinct buttons in HTML and CSS?

I've been experimenting with animating a sprite by using different onClick button triggers. I encountered an issue where only one of the buttons works correctly in the fiddle. However, in my local file version, the other buttons work but only once and ...

Steps to create a clickable background element for an AFTER li:

How can I make the background arrow clickable in my list, just like the link? .listacategorias li:after { float:right; content: ""; display: block; background: url("//d26lpennugtm8s.cloudfront.net/stores/567/260/rte/setaazul.png") no-repeat; ...

Different methods for creating a dynamic asp.net web Grid for mobile user interface (utilizing block display and selective column hiding)

Currently, I am developing a web application using asp.net mvc-4 and incorporating bootstrap 2.0 into the design. The main tool I am utilizing in almost every controller is the asp.net mvc web grid due to its efficient sorting, paging, and minimal code req ...