<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
<div class="left-nav">
<ul>
<li><img src="" alt="logo"></li>
<li><input type="search"></li>
<li><img src="" alt="hit"></li>
</ul>
</div>
<div class="right-nav">
<ul>
<li><img src="" alt="dp"></li>
<li>Name</li>
<li>i1</li>
<li>i2</li>
<li>i3</li>
<li>i4</li>
<li>i5</li>
</ul>
</div>
</nav>
<main>
<div class="left-content">
<p>Left Content</p>
</div>
<div class="center-content">
<p>Center Content</p>
</div>
<div class="right-content">
<p>Right Content</p>
</div>
</main>
</body>
</html>
I'm having trouble with making the navigation bar sticky in my web development project. When I set the position to 'fixed', it works fine, but I want it to be sticky at the top as we scroll, similar to Facebook's navigation bar. I'm trying to create a Facebook clone as a beginner learning web development. The first code snippet represents the HTML structure, while the second one contains the CSS styles.