title: CSS: Having trouble aligning two flex elements
body: <p>I have a flex container with a background, and it contains some text consisting of vertically and horizontally center aligned content (page title) and absolute aligned content (breadcrumb).</p>
  
  <p>Everything looks great when I have just the title, I've obviously got something messed up with the breadcrumb classes.</p>
  
  <p>I would like the breadcrumbs to be right aligned and 25px from the top within the container (see example):</p>
  
  <p>Any idea where it's going wrong?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#site-wrapper {
    background: #ececec;
  }
  .site-wrapper-inner {
    overflow: hidden;
    position: relative;
    background: #fff;
  }
  .site-wrapper-inner.contained {
    max-width: 1500px;
  }
  .container {
    margin: 0 auto;
    width: 100%; 
  }
  header .container, 
  main .container {
    position: relative;
    padding: 0 30px;
    max-width: 1118px;
  }
  header.hero {
    position: relative;
    clear: both;
    overflow: hidden;
    height: 340px;
    margin-bottom: 50px;
    display:flex;
    align-items:center;
  }
  .container.hero-center {
    text-align: center;
    max-width: 560px;
  }
  .breadcrumbs {
    color: rgba(255,255,255,0.7);
    font-size: 0.8em;
    align-self: flex-start;
    text-align: right;
    position: absolute;
    top: 25px;
    right: 0;
  }
  .breadcrumb-bg {
    padding: 0.2em 1em;
    background: rgba(19,71,91,0.7);
    display: inline-block;
    border-radius: 0.25em;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="site-wrapper"&gt;
    &lt;div class="site-wrapper-inner container contained"&gt;
      &lt;main id="main"&gt;
        &lt;section&gt;
          &lt;header class="hero" style="background:#ccc;"&gt;
            &lt;div class="breadcrumbs container"&gt;&lt;div class="breadcrumb-bg"&gt;Breadcrumb&lt;/div&gt;&lt;/div&gt;
            &lt;div class="hero-center container"&gt;
              &lt;h1&gt;Center Aligned Content&lt;/h1&gt;
            &lt;/div&gt;
          &lt;/header&gt; 
        &lt;/section&gt;
      &lt;/main&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;h1&gt;Without Breadcrumb&lt;/h1&gt;
  
  &lt;div id="site-wrapper"&gt;
    &lt;div class="site-wrapper-inner container contained"&gt;
      &lt;main id="main"&gt;
        &lt;section&gt;
          &lt;header class="hero" style="background:#ccc;"&gt;
            &lt;div class="hero-center container"&gt;
              &lt;h1&gt;Center Aligned Content&lt;/h1&gt;
            &lt;/div&gt;
          &lt;/header&gt; 
        &lt;/section&gt;
      &lt;/main&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>