View Full Version : format paragraph containing a custom word

09-19-2011, 08:07 AM
I'm trying to add some css tags (<strong>, <em> etc) to an entire paragraph <p> that contains a custom word, for example a paragraph like this <p>Title:....</p>

This could be easily done for the custom word only with a var.str and document write. I would be grateful if you could post the entire code.

09-19-2011, 03:59 PM
This can be done in CSS with the ":contains" pseudo-class

p:contains("Title:") {
background-color: yellow;