Ensuring your HTML is valid is crucial. For instance, eliminating unnecessary closing tags like </div>
, ensuring there are opening <li>
tags for every closing </li>
tag, and so on.
To incorporate a navigation bar in the header, simply place your code within the header div.
I have made some adjustments and provided an example of what properly formatted HTML looks like.
<!DOCTYPE html>
<html lang="en">
<header>
<meta charset="UTF-8" />
<title>Home</title>
<link rel="stylesheet" type="text/css" href="Home.css" />
<div class="header">
<div class="page-title">
<img src="img/logo.png" alt="logo" />
<h1>Empowering The Nation</h1>
</div>
<div>
<ul class="navigation">
<li><a href="Home.html">Home</a></li>
<li><a href="Courses.html">Courses</a></li>
<li><a href="Pricing.html">Pricing</a></li>
<li><a href="Contact.html">Contact Us</a></li>
<!--Why this button ?-->
<li><a href="Sign In.html"><button>Sign In</button></a></li>
</ul>
</div>
</div>
</header>
<body>
<div>This is the body of the page</div>
</body>
</html>
<style>
.header {
display: flex;
justify-content: space-between;
}
.page-title {
display: flex;
justify-content: flex-start;
align-self: center;
}
img {
align-self: center;
}
</style>