New course! Every coder should learn Generative AI!
Try a free lesson+ 5
<p style="color: red">Hello World!</p>
+ 4
With the attribute color.
+ 2
Shivam HTML course is available
https://www.sololearn.com/Course/HTML/?ref=app
+ 2
You can set the color in the html self lie this
<p style="color: red">Hello World!</p>
or like this
<p style="color: #FF0000">Hello World!</p>
But the best way is to set the color in CSS like this
<head>
<style>
p {color: red;}
</style>
</head>
Make sure you declare the head before the body.
It's also best to make a seperate stylesheet if you have a lot of style or want to use the same style on different pages.
+ 1
https://www.w3schools.com/html/html_styles.asp
Hope it's helpful to you