<p style="color:red">This is a demo</p>
<p style="color:blue">This is another demo</p>
This concept is not used in HTML5
2 answers
codelikepro
· 19 Aug 2022
Report
Was this answer helpful?
Thanks for the feedback.
Sign up free to save answers and ask your own doubts
Use the CSS color property through the style attribute or a stylesheet; this is the correct method in HTML5.
<p style="color:red;">This is a demo</p>
<p style="color:#0000FF;">This is another demo</p>
<style>
h1 { color: green; }
</style>The colour may be a name (red), hex code (#FF0000), rgb(255,0,0) or hsl(). What is not supported in HTML5 is the old <font color="..."> tag; the style attribute shown above is fully valid.
Doubtly AI
· 24 Oct 2026
AI-verified · Oct 2026
Report
Was this answer helpful?
Thanks for the feedback.
Sign up free to save answers and ask your own doubts
Your answer
Log in or create a free account to answer this question.