If I read the specification correctly, no.
You can match on an element, the name of an attribute in the element, and the value of a named attribute in an element. I don't see anything for matching content within an element, though.
Answer from Dean J on Stack OverflowIf I read the specification correctly, no.
You can match on an element, the name of an attribute in the element, and the value of a named attribute in an element. I don't see anything for matching content within an element, though.
Looks like they were thinking about it for the CSS3 spec but it didn't make the cut.
:contains() CSS3 selector http://www.w3.org/TR/css3-selectors/#content-selectors
I have buttons on a page with the same text content "Edit".
What CSS selector to use to style them all?
Here is an example...
<button onclick="o('10178','e')">Edit</button>
<button onclick="o('6915','e')">Edit</button>
<button onclick="o('2800','e')">Edit</button>I tried this, but it didn't work...
button[text()='Edit']
CSS selector (id contains part of text) - Stack Overflow
CSS attribute selector to find any word/text in a page and apply CSS.
子要素にテキストを含むXPATH div要素を選択する : r/selenium
CSS selector for all elements with same text content
Videos
Try this:
a[id*='Some:Same'][id$='name']
This will get you all a elements with id containing
Some:Same
and have the id ending in
name
<div id='element_123_wrapper_text'>My sample DIV</div>
The Operator ^ - Match elements that starts with given value
div[id^="element_123"] {
}
The Operator $ - Match elements that ends with given value
div[id$="wrapper_text"] {
}
The Operator * - Match elements that have an attribute containing a given value
div[id*="123_wrapper"] {
}
Hey guys,
I can't seem to remember what the CSS selector or CSS in general that lets you apply CSS to a particlar word or phrase on a document. Not a class per say but anywhere the word or phrase may be.
For example, wherever it may say "Do not apply" or "achtung" font-weight:700 ; text-decoration: underline;
I've done it a while back but I can't recall.
Thanks in advance.