If you want to change the color of the first word of a text, you can use the CSS :before pseudo-element, which is used to add any element. Its value is defined with the content property. If it is not used, the content will not be generated and inserted.
In the example below, we use a <div> element with a class "word" and specify its color. Then, we add the :before pseudo-element to the "word" class and add the word the color of which we want to change with the color property. After that, we specify its color.
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
.word {
color: #000;
}
.word:before {
color: #f00000;
content: "Lorem";
}
</style>
</head>
<body>
<div class="word">
Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a
type specimen book. It has survived not only five centuries, but also
the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets
containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div[data-highlightword] {
position: relative;
color: #666666;
}
div[data-highlightword]::before {
content: attr(data-highlightword);
color: purple;
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<div data-highlightword="Example">
Example for you.
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
span {
color: green;
}
</style>
</head>
<body>
<div>
<span>Example</span> for you.
</div>
</body>
</html>