title: Select the element after next element in CSS
body: <p>The + operator selects the first element that is placed immediately after the given elements. But i want to select the next element that fulfils a condition.</p>
  <p>In the following example I want to remove the separator lines from the selected element. The separator lines are added before each visible element (but the first). So i have to remove it from the selected element and the element after.</p>
  <p>The difficult thing now is that elements can become invisible. This means that the next element in the DOM does not necessarily have to be the next visible element.</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>span[selected] {
    color: red;
     font-weight: bold;
  }
  
  span:not([visible]) {
    display: none;
  }
   
  span + span::before {
    content: ' | ';
  }
  
  span[selected]::before,
  span[selected] + span::before {
     color: white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;span visible&gt;A&lt;/span&gt;
  &lt;span visible&gt;B&lt;/span&gt;
  &lt;span &gt;C&lt;/span&gt;
  &lt;span visible selected&gt;D&lt;/span&gt;
  &lt;span&gt;E&lt;/span&gt;
  &lt;span visible&gt;F&lt;/span&gt;
  &lt;span visible&gt;G&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>But i looking for something like this to select the next visible element.</p>
  <pre><code>span[selected]::before,
  span[selected] + span[visible]::before {
    color: white;
  }
  </code></pre>
  <p>Thank you</p>