As you can see my nav bar is overlapping the main section of the documentation page. Is there a specific property I should know about to solve this problem or will I use the margin to align it with the nav bar. By the way I just started an hour ago so I know i will have a lot to work on!
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>PHP</title>
</head>
<body>
<nav id="nav-bar">
<br>
<ul>
<header>
<li>PHP Documentation</li>
</header>
<br>
<li id="nav-link">Introduction</li>
<li id="nav-link">PHP forms</li>
<li id="nav-link">PHP Advanced</li>
<li id="nav-link">PHP MySql Database</li>
<li id="nav-link">PHP XML</li>
<li id="nav-link">PHP Ajax</li>
<li id="nav-link">PHP Examples</li>
<li id="nav-link">Refrence</li>
</ul>
</nav>
<main>
<section class="main-section">
<header>Introduction</header>
<article>
<p>PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.</p>
</article>
</section>
<section class="main-section">
<header>PHP Forms</header>
<article>
<p>The PHP superglobals $_GET and $_POST are used to collect form-data.</p>
<p>The example below displays a simple HTML form with two input fields and a submit button:
Example</p>
<code>
html
body
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
body
html
</code>
</article>
</section>
<section class="main-section">
<header>PHP Advanced</header>
<article>
</article>
</section>
<section class="main-section">
<header>PHP Mysql Database</header>
<article>
</article>
</section>
<section class="main-section">
<header>PHP XML</header>
<article>
</article>
</section>
<section class="main-section">
<header>PHP Ajax</header>
<article>
</article>
</section>
<section class="main-section">
<header>PHP Examples</header>
<article>
</article>
</section>
<section class="main-section">
<header>Refrence</header>
<article>
</article>
</section>
</main>
</body>
</html>
*{
margin:0;
}
body{
background-color:#eef5f1;
}
#nav-bar{
background-color:#e5f1ea;
flex-direction: column;
width:15%;
height:100%;
position:fixed;
}
header{
margin-right: 20px;
}
li{
list-style:none;
}
.main-section{
margin-left:100px;
}