gpt4 book ai didi

html - 尝试创建 anchor 链接

转载 作者:行者123 更新时间:2023-11-28 05:13:13 24 4
gpt4 key购买 nike

我正在尝试在同一页面内创建一个基本的 anchor 链接。我正在使用 Bootstrap 4(无论是否有所作为)。链接和目标都在服务器端包含中。我想从上方的导航“联系人”链接到页脚中的表单。

在“upperNav”包括我有以下内容:

<a class="nav-link text-light main-menu" href="#contactMe">Contact</a>

在“页脚”中包含以下内容:

<p class="contactUs"><a id="#contactMe">Contact Us</a></p>

但由于某种原因它不起作用。我研究过这个问题,但无济于事。有什么建议吗?

<!--   From: https://www.jquery-az.com/bootstrap4/demo2.php?ex=91.0_8   -->
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-info ">
<a class="navbar-brand text-light logo-text" href="http://shamar.org/" >shamar.org</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#demo-navbar" aria-controls="demo-navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="demo-navbar">
<ul class="navbar-nav mr-auto" id="menu">
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/articles/index.html">Articles</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/weblog/">Blog</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/books.html">Books</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/multimedia/index.html">Multimedia</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="/about.html">About</a>
</li>
</li>
<li class="nav-item">
<a class="nav-link text-light main-menu" href="#contactMe">Contact</a>

</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-light submit2 my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>

最佳答案

改变

<a id="#contactMe">Contact Us</a>

<a id="contactMe">Contact Us</a>

关于html - 尝试创建 anchor 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51163465/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com