Is there a CSS selector for elements containing certain text

0 votes

I am looking for a CSS selector for the following table:

Peter    | male    | 34
Susanne  | female  | 12

Is there any selector to match all TDs containing "male"?

Aug 4 in CSS by Edureka
• 11,040 points
22 views

1 answer to this question.

0 votes

You'd need to add a data attribute named data-gender to the rows with a male or female value and utilize the attribute selector:

HTML:

<td data-gender="male">...</td>

CSS:

td[data-gender="male"] { ... }
answered Aug 5 by Tanishqa
• 700 points

Related Questions In CSS

0 votes
1 answer

Is there any way to colorize a white PNG image with CSS only?

Filters can be used with -webkit-filter and ...READ MORE

answered May 27 in CSS by Edureka
• 9,540 points
178 views
0 votes
0 answers

Is there a way to link in a stylesheet where the extension is not .css?

When I dynamically connect in the CSS ...READ MORE

Aug 8 in CSS by Edureka
• 11,040 points
169 views
0 votes
1 answer

How do I give text or an image a transparent background using CSS?

Use either a semi-transparent PNG or SVG ...READ MORE

answered May 27 in CSS by Edureka
• 9,540 points
49 views
0 votes
1 answer

Is there any way to animate an ellipsis with CSS animations?

You might try to time each ellipsis ...READ MORE

answered May 27 in CSS by Edureka
• 9,540 points
138 views
0 votes
1 answer

wildcard * in CSS for classes

Yes you can do this. *[id^='term-']{ ...READ MORE

answered Jun 21 in CSS by Edureka
• 9,540 points
63 views
0 votes
1 answer

jQuery vs document.querySelectorAll

As seen above, querySelector() methodcan only be used ...READ MORE

answered Jun 14 in JQuery by gaurav
• 18,960 points
212 views
0 votes
1 answer

input[type='text'] CSS selector does not apply to default-type text inputs?

Because that is not what it is ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
111 views
0 votes
0 answers

Combinators in CSS

everyone! I am quite new to HTML ...READ MORE

Jul 8 in CSS by Edureka
• 11,040 points
15 views
0 votes
1 answer

What is the meaning of "cascading' in CSS??

Cascading simply implies that it may be ...READ MORE

answered Aug 3 in CSS by Tanishqa
• 700 points
36 views
0 votes
1 answer

HTML/CSS - Adding an Icon to a button

Here's what you can do using font-awesome ...READ MORE

answered Aug 3 in CSS by Tanishqa
• 700 points
296 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP