Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
<p style="color: red">Hello World!</p>
4th Mar 2023, 7:46 AM
Knight
Knight - avatar
+ 4
With the attribute color.
4th Mar 2023, 6:47 AM
Ausgrindtube
Ausgrindtube - avatar
4th Mar 2023, 8:50 AM
R💠🇮🇳
R💠🇮🇳 - avatar
+ 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.
6th Mar 2023, 12:38 PM
Kevin Kraaijveld
Kevin Kraaijveld - avatar
4th Mar 2023, 7:11 AM
Sakshi
Sakshi - avatar