Encycodepedia is a reference guide to the common syntax and terminology used in everyday programming.
Encycodepedia CSS covers the styling component of building websites.
As I noted before in The Basics of Color post, there are three ways to enter in color in CSS; RGB, hexadecimal, and color names.
Today, we're going to cover the simplest of the three, color names.
Back in the early days of the Internet, before Myspace and Napster times, the Internet was very limited in how it could display colors. Like, browsers could only support a couple hundred colors, and that's it. A far cry from the almost infinite number of colors you can use in today's world of web development.
Because the number of colors was so limited, they were able to be given common names, the list of these colors became known as the x11 color list. Here's a small sample of the list.
Since then, the list was actually expanded to cover shades, the link to the full list is here.
While being able to just enter in the name of a color is super easy and convenient, in today's world of modern browsers, most designers and developers hardly use them unless for specific reasons. Mostly though, browsers sometimes disagree on the meaning of the color, so if your color is specific to your brand, you will want to go with precise coloring options that come with hexadecimal or RGB.
Mostly though, I use color names just to test out errors or flaws in sites to see where I'm having a problem.
Okay, to insert a color rule to your document, you just need to follow these steps.
First you're going to enter in the selector of the element you want selected, follow that up with opening and closing brackets. In-between the brackets, choose the property you need followed by a colon, and then the color name you desire. End this declaration with a semicolon, and you're done.
Here's an example of how this should go...
As I said before, while using color names is simple and easier than retaining millions of hexadecimal or RGB codes to memory, it does limit your choices in coloring greatly.