【问题标题】:Bootstrap - Redirects to a section of the page goes past the contentBootstrap - 重定向到页面的一部分会越过内容
【发布时间】:2022-11-18 08:03:36
【问题描述】:

视频-https://atproducts.xyz/media/Screen%20recording%202022-11-14%2011.33.21.webm
代码 - https://github.com/Alex-Toucan/atproducts.xyz/blob/main/index.html(太大而不适合这篇文章)

您好,StackOverflow 社区。我有一个问题,即重定向到页面的某个部分超过了所述部分。我认为这主要是由于填充主体以使固定顶部导航栏工作。提前致谢。

【问题讨论】:

  • 可能是标题与内容重叠。如果标头是 fixed 或 sticky,它会将其从 DOM 流中移除。尝试将 padding-top: //height-of-header px 添加到被阻止的元素。
  • 现在它看起来不均匀,有很多未使用的空间。 @莎拉
  • 如果您可以共享特定相关代码的 sn-ps,将更容易提供帮助。

标签: html css


【解决方案1】:

事实证明,我只需将 scroll-padding-top:56px; 添加到 html 标签即可。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    • 2013-09-05
    • 2023-03-14
    • 1970-01-01
    • 2017-10-25
    相关资源
    最近更新 更多