Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #36278
Closed
Open
Issue created May 05, 2022 by Julien Déramond@julien-deramondContributor3 of 3 checklist items completed3/3 checklist items

Doc: Extra top padding after having clicked on anchor links

Prerequisites

  • I have searched for duplicate or closed issues
  • I have validated any HTML to avoid common problems
  • I have read the contributing guidelines

Describe the issue

An extra padding top is created for each section after having clicked on the anchor links in the documentation.

Basic rendering

Rendering after the manipulation (with the extra top padding)

I haven't looked at the issue precisely but this is probably related from near and far to:

.bd-content>:target {
 padding-top:5rem;
 margin-top:-5rem
}

It has changed in https://github.com/twbs/bootstrap/commit/195440f2fb1e94c014a9cf08f3eae40f3d224620.

Nothing has been tested yet on my side but there was another system in place before apparently based on:

// Offset for the sticky header
@include media-breakpoint-up(md) {
  :root {
    scroll-padding-top: 4rem;

Note: It happens with all breakpoints.

Reduced test cases

1st test case

After having clicked on "Importing", the padding-top stays on top until the page is refreshed.

Peek 2022-05-05 08-43

2nd test case

It is maybe more obvious in this video. We can directly see the extra padding on top of "CSPs and embedded SVGs" that's added even if the content is not near the header.

Peek 2022-05-05 08-43 (2)

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.2.0 (current main branch)

Assignee
Assign to
Time tracking