Skip to content

Unwanted border-bottom on .active nav-tab in Bootstrap 5 #41225

Open
@pbuttelli

Description

Prerequisites

Describe the issue

Description:
An unexpected border-bottom appears on the active .nav-tabs item in Bootstrap 5. This behavior occurs even in the official documentation examples. The issue seems related to rendering inconsistencies, as slight changes in layout (e.g., padding adjustments) affect the visibility of the border.

Environment:

  • Bootstrap Version: 5.3.3
  • Browser: Firefox 134.0 (64-bit)
  • OS: Ubuntu 20.04

Steps to reproduce:

  • Open a page with Bootstrap 5’s .nav-tabs.
  • Set different padding values on <body>.
  • Observe that the active tab sometimes shows a border-bottom that shouldn’t be there.

Screenshots:

<body> with padding: 4rem
Image

<body> with padding: 2rem
Image

Reduced test cases

Applying margin: 1px 0 to .nav-tabs seems to mitigate the issue:
Image

Possible cause?
This could be a browser rendering quirk, possibly due to subpixel rounding issues affecting how the tab's active state is calculated. It seems to be more noticeable in Firefox on Linux, but further testing is needed to confirm if this affects other environments.

Related issues (previous major versions of Bootstrap):

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

v5.3.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions