I want to select the very first match of a paragraph <p>
containing the attribute data-result="INVALID"
using css.
I have tried this little script without any success. No element gets selected.
I am limited to only css for this solution (No jQuery). Is there any solution for this problem ?
p[data-result="INVALID"]:first-of-type {
color: red;
}
<p data-result="VALID"><b>Note:</b> a:active MUST come after a:hover in the CSS definition in order to be effective.</p>
<p data-result="INVALID"><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.</p>
<p data-result="INVALID"><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.</p>