为什么我的内部超链接在哈巴狗中不起作用?
我正在开发一个个人博客,该博客在同一页面上有多个部分,我想通过在顶部用锚标记链接它们来导航到不同的部分。
当我单击链接时,地址栏中的 URL 会发生变化,但我无法使用 id 导航到正确的部分。这是代码结构。
extends /_includes/layout
block title
title
block content
.cb-layout#view-main
.cb-content
.cb-tabs.-inverse
.cb-tabs-navs
h3
a(href="#about") ABOUT
h3
a(href="#projects") PROJECTS
h3
a(href="#contributions") CONTRIBUTIONS
h3
a(href="#social") SOCIAL
//- .cb-tabs-nav.-active
//- .cb-tabs-nav
//- .cb-tabs-nav
section.cb-outro#about
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 About
.cb-outro-list
section.cb-outro#areas-of-interest
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Areas of Interest
.cb-outro-list
section.cb-outro#currently-learning
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Currently Learning
.cb-outro-list
section.cb-outro#projects
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Projects
.cb-outro-list
section.cb-outro#contributions
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Open Source Contributions
.cb-outro-list
section.cb-outro#social
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Social
.cb-outro-list
我是哈巴狗新手,有人可以告诉我出了什么问题吗?我长期以来一直在努力解决这个问题,任何帮助将不胜感激。
I am working on a personal blog that has multiple sections on the same page and I would like to navigate to the different sections by linking them at the top with an anchor tag.
The URL changes in the address bar when I click the link but I'm not able to navigate to the correct section with the id. Here's the code structure.
extends /_includes/layout
block title
title
block content
.cb-layout#view-main
.cb-content
.cb-tabs.-inverse
.cb-tabs-navs
h3
a(href="#about") ABOUT
h3
a(href="#projects") PROJECTS
h3
a(href="#contributions") CONTRIBUTIONS
h3
a(href="#social") SOCIAL
//- .cb-tabs-nav.-active
//- .cb-tabs-nav
//- .cb-tabs-nav
section.cb-outro#about
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 About
.cb-outro-list
section.cb-outro#areas-of-interest
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Areas of Interest
.cb-outro-list
section.cb-outro#currently-learning
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Currently Learning
.cb-outro-list
section.cb-outro#projects
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Projects
.cb-outro-list
section.cb-outro#contributions
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Open Source Contributions
.cb-outro-list
section.cb-outro#social
.cb-outro-content
.cb-outro-container
.cb-outro-header
h2 Social
.cb-outro-list
I'm new to pug and can someone tell me what's wrong? I've been trying to fix this for so long and any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论