Copyright © tutorialspoint.com
The color property sets the foreground color of an element (typically, the color of the text).
All the HTML elements.
object.style.color="#a1a1a1"; |
Here is the example which shows effect of this property:
<h2 style="color:olive;"> This text will have olive color. </h2> <p style="color:#3300CC"> This text will have blue color. </p> <div style="color:rgb(224,37,197);"> This text will have pink color. </div> |
This will produce following result:
This text will have olive color.This text will have blue color.
This text will have pink color.
|
To Become more comfortable - Do Online Practice
Copyright © tutorialspoint.com