HTML colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.

Background Color

You can set the background color for HTML elements:

Example

<h1 style="background-color:DodgerBlue;">Hello World</h1>
<p style="background-color:Tomato;">Hello from me...</p>

 

Text Color

You can set the color of text:

<<h1 style="color:Tomato;">Hello World in Tomato</h1>
<p style="color:DodgerBlue;">Hello World in DodgerBlue ...</p>
<p style="color:MediumSeaGreen;">Hello World in MediumSeaGreen ......</p>

 

Border Color

You can set the color of borders:

<h1 style="border:2px solid Tomato;">Hello World</h1>
<h1 style="border:2px solid DodgerBlue;">Hello World</h1>
<h1 style="border:2px solid Violet;">Hello World</h1>

 

Leave a Reply

Your email address will not be published. Required fields are marked *