Aligning elements left, center and right in flexbox

Use justify-content: space-between; like this:

.container {
  display: flex;
  justify-content: space-between;
}
<div class="container">
  <div>A</div>
  <div>B</div>
  <div>C</div>
</div>

Use nested flex containers and flex-grow: 1.

This allows you to create three equal-width sections on the nav bar.

Then each section becomes a (nested) flex container which allows you to vertically and horizontally align the links using flex properties.

Now the left and right items are pinned to the edges of the container and the middle item is perfectly centered (even though the left and right items are different widths).

.nav {
  display: flex;
  height: 50px;      /* optional; just for demo */
  background: white;
}

.links {
  flex: 1;          /* shorthand for: flex-grow: 1, flex-shrink: 1, flex-basis: 0 */
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border: 1px dashed red;
}

.header-title {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed red;
}

.logout {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border: 1px dashed red;
}

.links a {
  margin: 0 5px;
  text-decoration: none;
}
<div class="nav mobilenav">

  <div class="links">
    <a href="/institutions/">Institutioner</a>
    <a href="/leaders/">Ledere</a>
  </div>

  <div class="header-title">Institution institution 1</div>

  <div class="logout"><a class="button-dark" href="/user/logout">Log ud</a></div>

</div>

jsFiddle


Css grid will do this better than flexbox.

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
}
button {
  display: inline-block;
}
.short-content {
  margin-left: auto;
}
<div class="grid">
  <div class="long-content">
    This has content that is fairly long
  </div>
  <button>CTA Button</button>
  <div class="short-content">
    Small Text
  </div>
</div>