Drew Fiero's Website

All about CSS Colors

How to Use CSS Colors

CSS colors is a very important step in creating a web page with a unique design of colors. You can use colors on your font, background, borders, and etc. Using too much color can distract users who enter your site and may even lead them to leave because the colors are everywhere or too much. It is important to use colors accordingly.

To use colors in your CSS code you can use it by name, RGB, or numbers. Currently there are 147 CSS color names otherwise if you are looking for a certain color, you might want to go with RGB or RGBA. RGB stands for red-green-blue and you do how much of each color to get the color you want. My first example will be of how to insert a color name:

   
								border:2px solid darkmagenta;
      							background-color: orange;
      							color: teal;
							

As you can see it's pretty straight forward with the color names and you can search the internet for different color names to use. Also, if you see an "a" after RGB down below it's just the red-green-blue-alpha which means: RGBA color values are an extension of RGB color values with an alpha channel - which specifies the opacity of the color. Next I'll show you how to use RGB and RGBA:

								color: rgb(224,65,37);
								background-color: rgba(255,100,100,.5);