I have a paragraph like this
<p> Lorem ipsum dolor sit amet, /* consectetur adipiscing elit. */ </p>
I want to have a CSS class that have a different font color for the text between /* and */
Thanks for help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t use
Expressionsto do this.CSS / HTML Way, by inserting an element inside.
You can use this way:
CSS:
Demo: http://jsfiddle.net/jNvSw/
Or, if you wanna do in the JavaScript way (uses jQuery, but it can also be done using pure JavaScript):
Demo: http://jsfiddle.net/jNvSw/1/