Skip to content

Alignment issue with floating labels and small select (form-select-sm) padding in Bootstrap 5.3 #41008

Closed
@patrickzzz

Description

Prerequisites

Describe the issue

I have encountered an alignment issue when using Bootstrap 5.3’s floating labels with the small select element (form-select-sm). The selected value is misaligned, appearing further to the left than the floating label due to the reduced padding applied to the small select.

Steps to reproduce:

1.	Create a form with a floating label using the form-floating class.
2.	Include a select element with the class form-select-sm.
3.	Observe that the selected value does not align with the floating label.

Expected behavior:
The selected value should align correctly with the floating label, regardless of the select size.

Actual behavior:
The selected value is offset to the left, causing misalignment with the label.

For a reduced test case demonstrating this issue, please refer to my CodePen link: [VIew on Code Pen].

Reduced test cases

https://codepen.io/patrickzzz/pen/GRVXjLK

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

macOS

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

Chrome

What version of Bootstrap are you using?

v5.3.3 (latest)

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions