Color for the web
Specify colors with HTML
The color property allows you to specify the color of text inside an element. There are several methods to declare your colors. These include:
By far, the most popular is Hexadecimal or "hex" for short. We will be using hex and RGBA values for almost everything we do in this course. We will employ RGBA when we wish to set an alpha transparency value along with our color. Keywords are a quick way to add a color if you do not have time to look up a proper color value, so we may throw a few in, just to demonstrate their use.
The color property allows you to specify the color of text inside an element. There are several methods to declare your colors. These include:
- Hexadecimal (#)
- Keywords (color name)
- RGB
- RGBA
- HSL
- X11
By far, the most popular is Hexadecimal or "hex" for short. We will be using hex and RGBA values for almost everything we do in this course. We will employ RGBA when we wish to set an alpha transparency value along with our color. Keywords are a quick way to add a color if you do not have time to look up a proper color value, so we may throw a few in, just to demonstrate their use.
Syntax to define color:
color: white;
color:#ffffff;
color:#fff
color:rgba (255,255,255,1);
color:hsla(360, 100%, 100%, 1);
All of the above colors are WHITE.
There are MANY tools online that will allow you to pick color and get the values other than your code editor, your photoshop. Here is just one example.
There are MANY tools online that will allow you to pick color and get the values other than your code editor, your photoshop. Here is just one example.