twbs / twbs/bootstrap

text-truncate adding extra height to display block elements

Open
#36,943 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css v5
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

when we add display block elements with text-truncate, it adds little extra space in the bottom.
check here: https://codepen.io/jeysaravana/pen/YzaOZzd
Screen Shot 2022-08-11 at 12 10 04 PM

adding vertical-align: top; to inline style or adding align-top to the same elements are not fixing the issue.

only way to fix the issue is adding vertical-align: top; to text-truncate will fix the issue.

.text-truncate {
    vertical-align: top;
}
Reduced test cases

adding vertical-align: top; to text-truncate will fix the issue.

.text-truncate {
    vertical-align: top;
}
What operating system(s) are you seeing the problem on?

macOS

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

Firefox

What version of Bootstrap are you using?

5.0.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the CodePen example in Firefox on macOS and inspect the .text-truncate styling described in the issue. Confirm the extra height for display block elements and verify that the completed change removes the unwanted bottom space without breaking truncation.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.