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/

相关文章:

html - 在 Bootstrap 4 中强制使用单个水平导航

javascript - 在计数时停止If and Else语句

php - 在 PHP 页面中添加 CSS 代码(不是文件)

css - Firefox Windows/Linux 不稳定

html - 通过其类名获取第三个 div

html - 表中的 Div

javascript - < Canvas > : Remove the 2d context from memory without removing the webgl context from memory

html - 无法让 li 项占用 ul 内的所有空间

html - 如何使两个并排的 div 元素保持相同的高度?

html - 如何使用 :hover