How to change the text color of an element in HTML?

Use the color attribute in HTML to display the color of the text.

Note − This attribute is not supported in HTML5.


You can try to run the following code to learn how to implement color attribute in HTML −

<!DOCTYPE html>
      <title>HTML Background Colors</title>
      <table width = "100%">
               <p><font color="blue">This is demo text.</font></p>

Updated on: 24-Jun-2020

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started