CSS elements – Color

compiled by Kay Oliver Seiferdt

Source- http://www.valueabled.com/images/7281iB418A57CFB33B469_e8c79ce6-35f5-4.jpg


Property-color changes the color of the text, border, background or every other element, where color is visible. The value can be assigned in different ways.

  1. just the Name of the color like – red, green, blue
  2. rgb(value, value, value) and the value in the parenthesis is a number between 0 and 255
    • rgb() means red, green, blue – the primary colors
    • the three values in the parenthesis are the strength of each color
      • rgb(255,0,0) – means red, because green and blue have a value of 0, so not available
      • rgb(255,255,0) – means yellow because you mix red and green with the max value.
    • many varieties through different strength of those colors
  3. hexadecimal code – # and 6 symbols
    • Symbols – 0 to 9 and A to F (A stand for 10 and F for 15)
    • most varieties of colors
    • a little similar to rgb() because the first two symbols representative red, the next two – green and the last two – blue
    • #FF0000 will display red because of the highest value, which is F and  green = 0  and blue = 0.
    • #00FF00 – green | #000000 – black | #FFFFFF – white

The explained color assignment is usable for every situation, where colors are available. Attached are a few examples, where the different ways are visible.

css - colorcolor





Leave a Reply

Your email address will not be published.