我一直遇到这行html的问题我一直收到错误但无法找到来源,错误突出显示在最后一个div的末尾,但当我删除它时出现错误在身体标签的末尾。 https://jsfiddle.net/LfxLhcap/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flower Shop</title>
</head>
<link rel="stylesheet" href="style.css">
<body>
<div class="wrapper">
<header>
<img src="images/red_rose.jpg" alt="red rose banner"/>
</header>
<nav>
<ul class="navlist">
<ul>
<li class="our staff"></li><a href="our_staff.html">our staff</a>
<li class="our product"></li><a href="our_product.html">our product</a>
<li class="our mesage"></li><a href="our_message.html">our message</a>
</ul>
<div class="image">
<img src="images/woman_smiling.jpg" alt="women smilling">
</div>
<div class="content">
<h1>Welcome to Flowershop.com</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nec dolor ipsum. Fusce in nunc lorem, dictum eleifend augue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris eu lectus id nisi adipiscing eleifend vitae a nisi.</p>
</div>
<div class="right_column">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nec dolor ipsum. Fusce in nunc lorem, dictum eleifend augue. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris eu lectus id nisi adipiscing eleifend vitae a nisi.</p>
</div>
</div>
<footer></footer>
</body>
</html>
也非常感谢在css中将women_smiling
右侧的两个段落对齐的提示
答案 0 :(得分:1)
你的html中有语法错误:
<ul>
有两个开始标记,但只有一个结束标记(</ul>
)。<nav>
但没有结束标记的开始代码。另一个问题是,您的<li>
元素不包含<a>
元素:
<li class="our staff"></li><a href="our_staff.html">our staff</a>
应该是:
<li class="our staff"><a href="our_staff.html">our staff</a></li>
你应该问一个关于对齐的单独问题(在搜索之后 - 它已经被要求了)。
答案 1 :(得分:0)
您缺少nav标签的关闭标签和带有navlist类的ul标签。