After researching how to create a horizontal list (Navigation Bar), I decided to include a header for the current page alongside the navigation links on the same line. However, when I view the file in a browser, the header and horizontal unordered list are displayed on separate lines, even though their display properties are set to inline. What could be causing this issue and is there a simple solution?
.header {
display: block;
margin: auto;
}
#nav_bar ul li, #nav_bar h1{
display: inline-block;
border: 1px solid black;
}
#nav_bar a:link, #navbar a:visited {
color: black;
}
<!DOCTYPE html>
<html>
<head>
<title>myWebpage</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<a href="http://example.com/"><img src="example.jpg" class="header" /></a>
<div id="nav_bar">
<h1>Home</h1>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="foo.html">Foo</a></li>
<li><a href="bar.html">Bar</a></li>
<li><a href="baz.html">Baz</a></li>
</ul>
</div>
</body>
</html>