W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Select elements based on text content

From: David Chambers <david.chambers.05@gmail.com>
Date: Tue, 30 Mar 2010 00:33:08 +1300
Message-ID: <553826751003290433l4442e727n62951533ee57f06f@mail.gmail.com>
To: www-style@w3.org
I've done some Google searches to find out whether this has been discussed
in the past, and failed to find anything. It's quite possible, though, that
I don't know the appropriate keywords.

Here's an example:

    <th>Internet Explorer</th>

To apply styling to the noes, one could do the following:

td.unsupported { font-weight: bold; color: red; } /* <td
class="unsupported">No</td> */


td[rel="unsupported"] { font-weight: bold; color: red; } /* <td
rel="unsupported">No</td> */

Does CSS3 include a selector which matches elements based on their text
content? It would be fantastic, in this example, to be able to select all td
elements whose text content is "No".

Received on Monday, 29 March 2010 11:33:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:44 UTC