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, 2022 in CSS by Edureka
• 13,130 points
171 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, 2022 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, 2022 in CSS by Edureka
• 11,930 points
821 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, 2022 in CSS by Edureka
• 13,130 points
890 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, 2022 in CSS by Edureka
• 11,930 points
172 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, 2022 in CSS by Edureka
• 11,930 points
444 views
0 votes
1 answer

wildcard * in CSS for classes

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

answered Jun 21, 2022 in CSS by Edureka
• 11,930 points
218 views
0 votes
1 answer

jQuery vs document.querySelectorAll

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

answered Jun 14, 2022 in JQuery by gaurav
• 22,970 points
2,297 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, 2022 in CSS by Edureka
• 11,930 points
685 views
0 votes
0 answers

Combinators in CSS

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

Jul 8, 2022 in CSS by Edureka
• 13,130 points
59 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, 2022 in CSS by Tanishqa
• 700 points
286 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, 2022 in CSS by Tanishqa
• 700 points
3,523 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP