html colores code example

Example 1: how to color in html

<h1 style="color: red;">Hello</h1>

Example 2: color selector html

<input type="color" value="#f6f82" id="colorPicker">

Example 3: color in html

<!-- Color in HTML by inline-css -->
<p style="color: red; background-color: blue;">
  This text is red and the background is blue
</p>

Example 4: possible colors used for html

#FF0000 means FF worth of Red, and no Green or Blue. The result is RED.

#0000FF means no Red or Green, and FF worth of Blue. The result is BLUE.

#FFFF00 means FF worth of Red and Green, and Blue. The result is YELLOW.

#000000 means no Red, Green, or Blue. The result is BLACK.

#FFFFFF means full FF amounts of Red, Green, and Blue. The result is WHITE.

#FFEFD5 has high values for all colors, giving a light result: PAPAYAWHIP.
   (no, I don't know who thought up the color names.)

#556B2F has lower values for all colors, giving a darker result: DARKOLIVEGREEN.

Example 5: possible colors used for html

#FFEFD5 (PAPAYAWHIP)   and

#556B2F (DARKOLIVEGREEN)

...are not web safe colors. They would get shifted to

#FFFFCC (NOT PAPAYAWHIP)   and

#666633 (NOT DARKOLIVEGREEN)

Example 6: colors.html

<!-- Here are some easy ones -->
#ffffff #ff0000 #00ff00 #0000ff #ff

Tags:

Css Example