MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

CSS Tutorials

Colors In CSS
Previous Home Next

CSS has several options for defining colors of both text and background areas on your pages.These options can entirely replace the color attributes in plain HTML. In addition, you get new options that you just didn't have in plain HTML.

CSS uses color values to specify a color. Typically, these are used to set a color either for the foreground of an element(i.e., its text) or else for the background of the element. They can also be used to affect the color of borders and other decorative effects.

Various types of colors in CSS

Colors in CSS are defined on a sRGB color space. sRGB stands for ďStandard Red Green BlueĒ where colors are defined through three channels: Red, Green and Blue. From there, we have various ways to describe color with CSS. Some of them like keywords and hexadecimal has been there almost since the beginning of the web, while other like HSL or RGB came later.

  • RGB: by itself, I donít use RGB since I usually use a color picker giving me hex triplet. But when I need to edit the alpha-channel, I use RGBa of course.
  • Hexadecimal: this is what I use the most in real projects. As said above, any web color picker on the internet will give you at least a hex code. Itís kind of the standard.
  • Keywords: I use them either for demos when I donít care much about the color I pick, or for greyscale like white, black and silver.
  • HSL: I never use HSL because Iím not used to it. Itís a really really good representation of the RGB model but it doesnít look very intuitive to me so I stick with RGB.


font:Arial, Helvetica, sans-serif; color:#000000;
p.rgb {
font:Arial, Helvetica, sans-serif; color:rgb(0,0,0);
p.colorname {
font:Arial, Helvetica, sans-serif; color:Black;
<p class="hexa">This is used to show hexadecimal color</p> 
<p class="rgb">This is used to show RGB color</p> 
<p class="colorname">This is used to show color with name</p>


Previous Home Next