title: CSS pipe selector with multiple classes
body: <p>Suppose I have two elements with multiple classes:</p>
  
  <pre><code>&lt;p class="fruit-apple something"&gt;First&lt;/p&gt;
  &lt;p class="whatever fruit-banana"&gt;Second&lt;/p&gt;
  </code></pre>
  
  <p>How can I use the “pipe” selector (<code>|=</code>) to select the <code>fruit-</code> classes?</p>
  
  <p>I have tried something like the following but this seems not to work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>p[class|=fruit] {
      color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p class="fruit-apple something"&gt;First&lt;/p&gt;
  &lt;p class="whatever fruit-banana"&gt;Second&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is clearly because in the second case, the class string does not begin with <code>fruit-</code>, and the selector is matching naively. </p>