gpt4 book ai didi

html - 为什么我不能正确链接导航栏?

转载 作者:行者123 更新时间:2023-11-28 14:55:27 25 4
gpt4 key购买 nike

我一直在尝试将一些按钮链接到其他页面,但是当我点击它时,它不会带我到任何地方。

<body>
<li class="nav-item "> <a class="nav-link" href="#About">About <span class="sr-only">(current)</span></a> </li>
<li class="nav-item"> <a class="nav-link" href="#Our Story">Our story</a> </li>
</li>
<li class="nav-item">
<a href="" id="img"> <img src="img/icons/starbucks_featured_image-1.jpg" alt="some text" height: "200" width="100"></a>
</li>
<li class="nav-item"> <a href="contact_US.html" class="nav-link"> social</a> </li>
<li class="nav-item"> <a href="Social_page.html" class="nav-link">contact</a> </li>
</ul>
</body>

最佳答案

您没有空缺<ul> (添加 class="nav" ,如果它是 Bootstrap)并有一个额外的 </li>在你的第四行:

<body>
<ul class="nav"> <!-- please add this -->
<li class="nav-item "> <a class="nav-link" href="#About">About <span class="sr-only">(current)</span></a> </li>
<li class="nav-item"> <a class="nav-link" href="#Our Story">Our story</a> </li>
</li> <!-- please remove this -->
<li class="nav-item">
<a href="" id="img"> <img src="img/icons/starbucks_featured_image-1.jpg" alt="some text" height: "200" width="100"></a>
</li>
<li class="nav-item"> <a href="contact_US.html" class="nav-link"> social</a> </li>
<li class="nav-item"> <a href="Social_page.html" class="nav-link">contact</a> </li>
</ul>
</body>

关于html - 为什么我不能正确链接导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51012353/

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