How do I get nav bar and logo on same line

Title is pretty much it. Doing the product landing page HTML/CSS project and I’m trying to get the nav links on the same horizontal line as the logo, as seen in the example. And how do I get it to the far right?

Here’s what I have so far:

<header id="header">
  <div class="logo">
    <img alt="movers logo" id="header-img" src="" width="150" />

      <nav id="nav-bar">
          <li><a class="nav-link" href="#Services">Services</a></li>
           <li><a class="nav-link" href="#pricing">Pricing</a></li>
li {
  float: left;
  list-style: none;
  font-family: Tahoma;


a {
  display: block;
  padding: 8px;
  background-color: #dddddd;

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


Hi @Champigne, one of the user stories calls for you to use CSS flexbox at least once. This is a good place to use it.

Hey @Champigne
I suggest doing it like this, and make adjustment from there

Important is to use display: inline; or
maybe better display: inline-block;
In this example logo is part of the list

.nav-bar {
  background-color: yellow; 
  list-style-type: none;
  margin: 0;
  padding: 0;

.nav-bar li {
  display: inline;
  font-size: 20px;
  padding: 15px;
<ul class="nav-bar">
<li><img src="" width="150"/></li>
  <li><a href="#home">Home</a></li>
  <li><a href="#about">About Us</a></li>
  <li><a href="#clients">Our Clients</a></li>  
  <li><a href="#contact">Contact Us</a></li>
1 Like