CSS Color Codes

When you want to set a color for your text or any other HTML element you will most likely need CSS Color Codes.

You can specify CSS Color Codes in 3 ways:

1. Setting the CSS Color by Color name
You can use any of these 16 colors: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.

Example:
<span style=”color:red;”>Sample text</span>
Output:
Sample text

2. Setting CSS Color Code by Color RGB Value
Since we’re limited by 16 CSS color names, the better way to find the exact color we want is by specifying its CSS RGB value. RGB stands for ‘Red Green Blue’, so if you want to set a red color you will set red to maximum, and green and blue to zero. Maximum value for a color is 255, so the value would look like rgb(255,0,0).

Example:
<span style=”color:rgb(255,0,0);”>Sample text</span>
Output:
Sample text

3. Setting CSS Color Code by Color Hex Value
The better way yet to set CSS Color Codes is to enter the CSS color hex value. For instance, color name ‘red’ has a hex value of ‘#FF0000′.
You can use our css color wheel to find hex value of any color.

Example:
<span style=”color:#FF0000;”>Sample text</span>
Output:
Sample text

Here is our CSS Color Wheel, happy coding!

Technorati Tags:

Bookmark this article! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • BlinkList
  • Furl
  • IndianPad
  • LinkaGoGo
  • Ma.gnolia

5 Responses to “CSS Color Codes”

  1. Devia Says:

    Pretty useful post, thanks.

  2. Sandy Says:

    Thanks. This will be useful.

  3. Cassidy Says:

    Nice. Thanks. I really like the color wheel — whatever it doesn’t matter. Anyway, I found this helpful! Thanks!

  4. ushno Says:

    Very helpful resource. Thank you very much.

  5. Muhammad Saeed Says:

    It solved my problem, May all related people live long with health & continuous prosperity.

Leave a Reply