我目前正在做免费代码营,并在产品登录页上工作。我一直收到一个错误,我的内部链接不能正常工作。代码可以在Codepen link上找到
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<div id="logo">
<header id="header">
<img src="" id='header-img' alt="company logo">
<nav id="nav-bar">
<ul>
<li><a href="#info" class="nav-link">Product information</a></li>
<li><a href="#locate" class="nav-link">Where to find</a></li>
<li><a href="#cost" class="nav-link">Pricing</a></li>
</ul>
</nav>
</header>
</div>
<a name="info"><p id="where-to-find">This is where product info can be found</p></a>
<video id="video" width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
<a name="locate"><p id="where-to-find">This is where product can be found</p></a>
<a name="cost"><p id="cost">Enter your e-mail to get a quote.</p></a>
<form action="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js" id="form">
<input name="email"
id="email"
type="email"
placeholder="Enter your email address"
required/>
<input id="submit" type="submit" value="Get Started" class="btn"/>
</form>错误如下面的截图所示。Free code camp error.
发布于 2020-01-31 04:39:12
嵌套<p>元素的所有<a>锚标记都应该有一个与导航栏锚链接相对应的id,但是所有锚标记都有name属性。用id属性替换所有的name属性,您的第五个测试应该会通过。
示例:
这一点:
<a name="info"><p id="product-information">This is where product info can be found</p></a>应该是:
<a id="info"><p id="product-information">This is where product info can be found</p></a>还有这个:
<a name="locate"><p id="where-to-find">This is where product can be found</p></a>应该是:
<a id="locate"><p id="where-to-find">This is where product can be found</p></a>https://stackoverflow.com/questions/59993896
复制相似问题