Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-19-2011, 07:07 AM   PM User | #1
ccristian
New to the CF scene

 
Join Date: Sep 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ccristian is an unknown quantity at this point
format paragraph containing a custom word

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.
ccristian is offline   Reply With Quote
Old 09-19-2011, 02:59 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 530 Times in 524 Posts
devnull69 will become famous soon enough
This can be done in CSS with the ":contains" pseudo-class

Code:
p:contains("Title:") {
   background-color: yellow;
}
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, format, text

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43 AM.


Advertisement
Log in to turn off these ads.