The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Select specific words using CSS
Is there a way to select specific words in a paragraph using pure CSS.
CSS works by styling elements based on a set of rules.
Unless the text is in element by itself with something that will differentiate it from other elements it’s not possible.
What you use to differentiate it is up to you.
Classes are the most obvious method, such as <span class="apple">Apple</span> but there are others, some more specific..like ID (that can only be used once) or broader, like data-attributes.