添加 .inner-head display:flex 将解决您的问题。请参阅下面的代码
.inner_header {
display: flex;
align-items: center;
}
.navigation {
/* float: right; */
margin-bottom:0;
display: block;
}
.navigation a {
height: 100%;
display: table;
float: left;
padding: 0px 20px;
}
.navigation a li {
display: table-cell;
vertical-align: middle;
height: 100%;
color:red;
}
<!DOCTYPE html>
<html>
<head>
<title>D&M Window Washing LLC</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class = "header">
<div class = "inner_header" >
<div class = "logo_container">
<h1>D&M<span>WindowWashing</span></h1>
</div>
<ul class = "navigation">
<a><li>Home</li></a>
<a><li>About</li></a>
<a><li>Reviews</li></a>
<a><li>Contact</li></a>
</ul>
</div>
</div>
</body>
</html>
所以我发现了你犯的错误。您拥有的 h1 元素是一个块元素,因此它占用了块空间,这就是您的菜单和标题徽标未并排对齐的原因。