I have a thought, and was curious to know if this is possible using CSS…
I am putting together a ‘newspaper-ish’ WordPress site. I’ve designed an H1 in a way that any instance of the word ‘THE’ is smaller and skewed a bit to save some space and to add a little jazz to the text.
Is it possible to target every instance of a particular word and give it it’s own style attributes? It wouldn’t be across all tags, only a select h1 style.
I work with document composition software that handles this type of thing via GREP expressions/styles in a great way and was curious if this was possible using CSS – or perhaps a blend of CSS, JS, HTML. This functionality could be extremely useful in dynamically built sites.
I think it would be super nice if CSS could do this, but everyone is correct of course, you cannot. I think it would be most likely that the syntax would select the parent if the text was found in the element. Like: