Premium Only Content

CSS Color Values with Hex Code and RGB
The lecture introduces you to another way of specifying a color in CSS.
Previously you learned that you can specify the color name, like red, green, or blue. But there are other ways of defining a color value, like using the hex value or the rgb value.
The hexadecimal value (aka hex) is a value that ranges from 0 to 255 in base 10, but is written in base 16 ranging from 0 to ff. That's why it's called hexadecimal, because one digit can have 16 different characters. It goes from the usual 0 to 9, then after that is goes using the letters a through f.
For the specific case of color hex codes, there are usually six digits. The first two digits are the value for the Red. The middle two digits are the values for the Green. The last two digits are the value for the Blue. Hence the abbreviation RGB whenever you need to compose those three colors to build any one color. For CSS, the hex value is always prefixed with a hash or pound sign.
You can also specify color values using base-10 RGB by saying rgb followed by parentheses. Inside the parentheses you write the values for RGB, separated by a comma. For example, for the Red value, instead of writing ff in hexadecimal, you would write 255 in decimal.
To show the red color, simply use value 255 for Red, 0 for Green, and 0 for Blue.
To show the green color, simply use value 0 for Red, 255 for Green, and 0 for Blue.
To show the blue color, simply use value 0 for Red, 0 for Green, and 255 for Blue.
-
LIVE
Right Side Broadcasting Network
18 hours agoLIVE: House Judiciary Hearing on Antitrust Law and the NCAA - 3/11/25
2,037 watching -
UPCOMING
The Tom Renz Show
22 minutes agoThe Globalist Engineered Economic Collapse Beginning With Attacks on Elon Musk, X & Tesla
-
LIVE
The Big Mig™
12 hours ago“DEI with a Side of Debt: Biden’s Trillion-Dollar Giveaway”
59 watching -
1:17:34
Dear America
12 hours agoMassive Cyberattack Against Elon's X Sparks Widespread CONCERN! + More Attacks On Tesla Vehicles?!
43.1K10 -
LIVE
Wendy Bell Radio
6 hours agoOver The Target
12,970 watching -
LIVE
Bitcoin Policy Institute
2 hours agoBitcoin for America
388 watching -
2 MIKES LIVE
1 hour agoTHE MIKE SCHWARTZ SHOW with DR. MICHAEL J SCHWARTZ 03-11-2025
11.8K1 -
34:43
Degenerate Jay
1 day ago $2.60 earnedAssassin's Creed Was Always Anti-Religion?
37.1K6 -
6:41
Silver Dragons
20 hours agoCanadian Silver Maple Leaf Coins - Dealer Reveals Everything You NEED to Know
29.5K3 -
8:42
Dangerous Freedom
18 hours ago $2.07 earnedThe M&P Competitor SHREDS—But Did Smith & Wesson Screw It Up?
28.8K2