title: I want to style every odd p element excluding hidden p element
body: <p>I am having below HTML content.</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>p.a {
    display: none;
  }
  
  p:not(.a):nth-of-type(odd) {
    background: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;text1&lt;/p&gt;
  &lt;p class="a"&gt;text2&lt;/p&gt;
  &lt;p&gt;text3&lt;/p&gt;
  &lt;p class="a"&gt;text4&lt;/p&gt;
  &lt;p&gt;text5&lt;/p&gt;
  &lt;p&gt;text6&lt;/p&gt;
  &lt;p&gt;text7&lt;/p&gt;
  &lt;p&gt;text8&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My expectation is that it should exclude the hidden elements while applying the background color, and the output should be as below:</p>
  
  <p><a href="https://i.stack.imgur.com/pvCyi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pvCyi.png" alt="enter image description here"></a></p>
  
  <p>Note: I cannot make any change in the HTML file.</p>
  
  <p>Could anyone please help me out?</p>