xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to set color to the text of an HTML element using CSS
CSS Online Editor
Run Code
More CSS Sample Codes
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Set color to the text of an HTML element using CSS</title> <!--Internal CSS added--> <style> /* text color of h1 element set to red*/ h1 { color: red; } /* text color of p element set to green*/ p { color: green; } </style> </head> <body> <h1>How to set color to the text of an HTML element using CSS?</h1> <p> CSS property <code>'color: red;'</code> is applied to the text of the <h1> element.</p> <p> CSS property <code>'color: green;'</code> is applied to the text of the <p> element.</p> </body> </html>