title: Adjacent sibling matches elements with display: none
body: <p>I have quite a simple bit of CSS formatting - or so I thought!</p>
  
  <p>I have two adjacent elements, the first of which can be hidden. I've used display: none to hide it.</p>
  
  <p>The second element is always present.</p>
  
  <p>I need to maintain a space between the two, so I thought the following bit of CSS would be sufficient:</p>
  
  <pre><code>.hidden + .visible {
      margin-left: 200px;
  }   
  </code></pre>
  
  <p>However, it seems that although the first element has display: none applied, the selector is still matches the second element as adjacent (not first), so applies the margin.</p>
  
  <p>Aside from finding it quite 'odd', I need to find a way of keeping a space between the two, but only when both are visible.</p>
  
  <p>Any ideas?</p>
  
  <p>There's a snippet attached with an example.</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>.container {
    margin: 50px;
  }
  .wrapper {
    background-color: aqua;
    display: flex;
    justify-content: flex-start;
  }
  .item {
    background-color: red;
    flex: 0 0 auto;
    height: 40px;
    width: 40px;
  }
  .hidden {
    display: none;
  }
  .visible {
    background-color: lime;
  }
  .hidden + .visible {
    margin-left: 200px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="wrapper"&gt;
      &lt;div class="item hidden"&gt;hidden&lt;/div&gt;
      &lt;div class="item visible"&gt;visible&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>