html - 我的 anchor 不工作

标签 html css

这是我的第一个元素(我不是网络开发人员,这只是一个例子)。 https://codepen.io/Ziratsu/pen/EWyoLN 我已经在我的标题中放置了 anchor ,用于我投资组合的不同部分,但是当我点击它们时它们不起作用.. 我已经输入了正确的“ID”,我不知道为什么这不起作用。

<button class="btn" id="Bouton1" type="button"><a  href="#textb">About</a></button>

这是我的 anchor 的引用,具有相同的 ID。

 <p id="textb"> Front-End Developer and UX/UI designer,</br> with practical experience in project management, branding strategy,</br> and creative direction; devoted to functional programming and information architecture.</br>Web Developer - User Experience Designer - Graphic Artist</p> </div>

感谢您花时间回复!

最佳答案

尝试使用 anchor 标记而不是按钮:

<a class="btn btn-primary" href="#textb">About</a>

如果您使用 Bootstrap ,您可以使用 btn 类使其看起来像一个按钮,我认为这是因为 btn 类。

关于html - 我的 anchor 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42782434/

相关文章:

css - 处理 cols 和 bootstrap 网格

html - CSS : Label/Textbox not displaying inline correctly

animation - :hover; force entire animation 上的 css3 动画

html - 显示宽度为 : table. 的等高列

html - 在段落标记中将两个 HTML 表单放在同一行

javascript - 如何在 angularjs 的 html 类属性中添加动态 css 类?

javascript - 悬停元素时显示/隐藏级联菜单

javascript - 如何获取特定对象的图像数据?

html - 为什么我的页脚不显示在正确的区域?我可以影响 CSS 吗?

html - 重复的按钮列表