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 text color using id and class name in 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 text color using id and class name in CSS</title> <!--Internal CSS added--> <style> /* css using id*/ #id-red { color: red; } #id-blue-color { color: blue; } /*css using class*/ .cl-green-color { color: green; } </style> </head> <body> <h1 id="id-red">How to set text color using id and class name in CSS?</h1> <!--id="id-red" is used--> <p class="cl-green-color">The CSS class name is used to set text color of this paragraph.</p> <!--class="cl-green-color" is used--> <p id="id-blue-color"> The CSS id name is used to set text color of this paragraph.</p> <!--id="id-blue-color" is used--> </body> </html>