From ebe5ac865e30dc2d4df869a869107e9f7034277a Mon Sep 17 00:00:00 2001 From: Adekanye Timilehin Date: Wed, 19 Dec 2018 08:21:00 +0100 Subject: [PATCH] More information added on Hexadecimal colors (#24850) * More information added on Hexadecimal colors * Added code formatting, reordered changes --- guide/english/css/css3-colors/index.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/guide/english/css/css3-colors/index.md b/guide/english/css/css3-colors/index.md index c95a6ec48db..6ed17063bd7 100644 --- a/guide/english/css/css3-colors/index.md +++ b/guide/english/css/css3-colors/index.md @@ -41,10 +41,8 @@ Hexadecimal values are yet another way to define colors in CSS and they work qui RR(Red), GG(Green), BB(Blue) are hexadecimal integers between 00 and FF specify the intensity of the color.
-A random hex code would like this: `#29432b`, where the first two characters after the hash stand for the amount of red in the mix, the second two stand for the amount of green and the last two stand for the amount of blue.
+A random hex code would like this: `#29432b`, where the first two characters after the hash stand for the amount of RED in the mix, the second two stand for the amount of Green and the last two stand for the amount of Blue. Unlike RGB color mixture where the values are in base 10, Hexadecimal color codes use base 16, or hexadecimal base, to specify color mixtures. -The values of `#000000` and `#ffffff` stand for black and white respectively.
-You can find the specific hexadecimal colors you require by using the same tools mentioned for the RGB values. ### Syntax @@ -53,8 +51,27 @@ p { color: #00fe00; } ``` + This rule again changes the font color of all p elements to green. +The values of `#000000` and `#ffffff` stand for black and white respectively. + +When a hex color code is composed of entirely of the same characters, the hex color can be abbreviated, like this: + +```css +h1 { + color: #FFFFFF; + color: #FFF; /* This is the same color as above */ +} + +h2 { + color: #FF33AA; + color: #F3A; /* This is the same color as above */ +} +``` + +You can find the specific Hexadecimal colors you require by using the same tools mentioned for the RGB values.
+ ### HSL HSL has three values.