If i have something like
<p id="something">My Text Here</p>
Is it possible to use some kind of pseudo-selector in CSS to apply a style only to certain text elements from my text?
Example, i want:
“My” to be color: red;
and “Text” color: blue;
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.
No, this is not possible.
There are pseudo-selectors such as
:first-letterand:first-line, but you cannot select invidual words without wrapping them in elements that you can individually style:You’d then be able to style them individually: