Home

How to Use the Web-Safe Color Palette for Your HTML5 and CSS3 Based Web Pages

|
Updated:  
2016-03-26 13:17:48
|
HTML5 and CSS3 All-in-One For Dummies
Explore Book
Buy On Amazon

A long time ago, browsers couldn't even agree on what colors they'd display reliably. HTML5 and CSS3 web developers responded by working within a predefined palette of colors that worked pretty much the same on every browser. Today's browsers have no problems showing lots of colors, but the so-called web-safe color palette is still sometimes used because it's an easy starting point.

The primary colors are all made of 0s and Fs: #FF0000is red (all red, no green, no blue). A web-safe color uses any combination of these values, so is web-safe, but is not.

Description Red Green Blue
Very bright FF FF FF
CC CC CC
99 99 99
66 66 66
33 33 33
Very dark 00 00 00

To pick a web-safe value from this chart, determine how much of each color you want. A bright red will have red turned on all the way (FF) with no green (00) and no blue (00), making #FF0000. If you want a darker red, you might turn the red down a little. The next darker web-safe red is #CC0000. If that isn’t dark enough, you might try #990000.

Say you like that, but you want it a little purple. Simply add a notch or two of blue: #990033 or #990066.

image0.jpg

The original problem web-safe colors were designed to alleviate is long resolved, but they're still popular as a starting point. Web-safe colors give you a dispersed and easily understood subset of colors you can start with. You don't have to stay there, but it's a great place to start.

About This Article

This article is from the book: 

About the book author:

Andy Harris earned a degree in Special Education from Indiana University/Purdue University–Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.
Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.
Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.
Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.
Andy welcomes comments and suggestions about his books. He can be reached at [email protected].