Re: Select elements based on text content

On 29.03.2010 13:33, David Chambers wrote:
> 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:
>
> <tr>
> <th>Chrome</th>
> <th>Firefox</th>
> <th>Internet Explorer</th>
> <th>Safari</th>
> </tr>
> <tr>
> <td>Yes</td>
> <td>Yes</td>
> <td>No</td>
> <td>Yes</td>
> </tr>
>
> To apply styling to the noes, one could do the following:
>
> td.unsupported { font-weight: bold; color: red; } /* <td 
> class="unsupported">No</td> */
>
> Alternatively:
>
> 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".
>
> David
There were some discussions about a ::text pseudo-class. Starts 
somewhere here: 
<http://lists.w3.org/Archives/Public/www-style/2010Jan/0017.html>

Received on Monday, 29 March 2010 16:37:30 UTC