我正在学习一步一步的网站。在导航部分,我使用代码链接主页,关于我们,联系我们,费率,服务页面,但是当我在关于我们和费率页面上链接时,整个内容文本页面链接指向它联系我们页面。不知道代码的错误是取消链接页面的正文内容但保留常规导航链接。 这里是关于美国页面的代码,其中“费率”页面使用相同的代码格式。我可以发布两个页面'必要时编码。谢谢。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>About Us: Home Cleaning Services in the SF Bay Area</title>
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="index.html">Home</li>
<li><a href="About US.html">About US</li>
<li><a href="Services.html">Services</li>
<li><a href="Rates.html">Rates</li>
<li><a href="Contact Us.html">Contact US</li>
</ul>
</nav>
</header>
<h2>We Talk Cleaning</h2>
<p>With a growing economy and a vibrant style of life, the SF Bay area has become home for professionals, families, artists and everyone who wants to be part of this great region. Due to this, it’s very difficult to devote time to clean or organize our space where we live or work. Sometimes we say to ourselves we will get to clean up our stubborn room or bathroom, but we don’t get to do it because you don’t have the time or the least thing you would like to do in your free time is to get to the obstinate place.</p>
<p> With Sparking Cleaning Services, we’ll make your life easier by providing a spotless and clean place for you to work or relax. One less thing to worry about in your life.</p>
<img src="Images/100_0016.jpg" alt="San Francisco View">
</body>
<footer>All Rights Reserved 2016</footer>
</html>
答案 0 :(得分:1)
正确的表格将是
<li><a href="index.html">Home</a></li>
<li><a href="About US.html">About US</a></li>
<li><a href="Services.html">Services</a></li>
<li><a href="Rates.html">Rates</a></li>
<li><a href="Contact Us.html">Contact US</a></li>
您的代码无效的原因是因为<a>
标记包含其开始和结束标记之间的所有内容,但由于您没有关闭它,因此将html页面的全部内容转换为链接
答案 1 :(得分:0)
您可以使用免费的在线HTML验证程序,例如html5.validator.nu来帮助您发现语法错误。选择“文本字段”并粘贴HTML。你有6个错误,有些可能是相同的。 Error 2) "Error: Unclosed element a"
,就像@Immortal Dude说的那样。