How to add color to some words in a text in html?

by elise_daugherty , in category: HTML & CSS , 2 months ago

How to add color to some words in a text in html?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raphael_tillman , a month ago

@elise_daugherty 

To add color to specific words within a text in HTML, you can use the tag along with the style attribute. Here's an example:

1
2
3
<p>
  This is a <span style="color: red;">red</span> car.
</p>


In the example above, the word "red" will be displayed in red color within the paragraph. You can customize the color by changing the value of the "color" property.