How To Use CSS Hex Code Colors with Alpha Values ... | alpha color code
IntroductionInCSS,thereareseveralformatsforcolors[1]thatcanbeused.Commononesincludehex(hexadecimal)codes,RGB(red,green,blue),RGBA(red,green,blue,alpha),andHSL(hue,saturation,lightness).Inthisarticle,youwillreviewhexcolorcodesandexploreusingalphavaluesfortransparency.PrerequisitesIfyouwouldliketofollowalongwiththisarticle,youwillneed:SomefamiliaritywithCSSisrequired.YoumaybenefitfromHowToBuildaWebsiteWithCSS[2]tutorialseriesifyouneedarefresher.Amodernwebbrowserthatsupports#rrggbbaahexcolornot...
IntroductionIn CSS, there are several formats for colors[1] that can be used. Common ones include hex (hexadecimal) codes, RGB (red, green, blue), RGBA (red, green, blue, alpha), and HSL (hue, saturation, lightness).
In this article, you will review hex color codes and explore using alpha values for transparency.
PrerequisitesIf you would like to follow along with this article, you will need:
Some familiarity with CSS is required. You may benefit from How To Build a Website With CSS[2] tutorial series if you need a refresher. A modern web browser that supports #rrggbbaa hex color notation. Using Color KeywordsFirst, CSS supports color keywords. Most browsers and devices can render these named colors into color values.
There are about 140 named colors[3] in CSS (like red, blue, lavender, etc.).
For example, if you wanted your text to have red color, you could use the keyword red:
div { color: red; }Different value formats, like hex code...