WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
×

CSS Reference

CSS Reference CSS Selectors CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS3 Browser Support

CSS Properties

align-content align-items align-self all animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-shadow box-sizing caption-side clear clip color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cursor direction display empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font @font-face font-family font-size font-size-adjust font-stretch font-style font-variant font-weight hanging-punctuation height justify-content @keyframes left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top max-height max-width @media min-height min-width nav-down nav-index nav-left nav-right nav-up opacity order outline outline-color outline-offset outline-style outline-width overflow overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before page-break-inside perspective perspective-origin position quotes resize right tab-size table-layout text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-justify text-overflow text-shadow text-transform top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility white-space width word-break word-spacing word-wrap z-index



 

CSS Legal Color Values


CSS Colors

Colors in CSS can be specified by the following methods:

  • Hexadecimal colors
  • RGB colors
  • RGBA colors
  • HSL colors
  • HSLA colors
  • Predefined/Cross-browser color names

Hexadecimal Colors

Hexadecimal shading esteems are upheld in all major browsers.

A hexadecimal shading is determined with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal whole numbers indicate the segments of the shading. All qualities must be among 00 and FF.

For precedent, the #0000ff esteem is rendered as blue, on the grounds that the blue segment is set to its most astounding quality (ff) and the others are set to 00.

Example

Define distinctive HEX colors:

#p1 {background-shading: #41dcf4;}  /* red */
#p2 {background-shading: #bb41f4;}  /* green */
#p3 {background-shading: #f44197;}  /* blue */

RGB Colors

RGB shading esteems are upheld in all major browsers.

An RGB shading esteem is determined with: rgb(red, green, blue). Every parameter (red, green, and blue) characterizes the power of the shading and can be a whole number somewhere in the range of 0 and 255 or a rate esteem (from 0% to 100%).

For precedent, the rgb(0,0,255) esteem is rendered as blue, since the blue parameter is set to its most astounding quality (255) and the others are set to 0.

Also, the accompanying qualities characterize approach shading: rgb(0,0,255) and rgb(0%,0%,100%).

Example

Define distinctive RGB colors:

#p1 {background-shading: rgb(255, 0, 0);}  /* red */
#p2 {background-shading: rgb(0, 255, 0);}  /* green */
#p3 {background-shading: rgb(0, 0, 255);}  /* blue */

RGBA Colors

RGBA shading esteems are upheld in IE9+, Firefox 3+, Chrome, Safari, and in Opera 10+.

RGBA shading esteems are an augmentation of RGB shading esteems with an alpha channel - which determines the haziness of the object.

An RGBA shading esteem is indicated with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (completely straightforward) and 1.0 (completely opaque).

Example

Define distinctive RGB hues with opacity:

#p1 {background-shading: rgba(255, 0, 0, 0.3);}  /* red with darkness */
#p2 {background-shading: rgba(0, 255, 0, 0.3);}  /* green with murkiness */
#p3 {background-shading: rgba(0, 0, 255, 0.3);}  /* blue with darkness */

HSL Colors

HSL shading esteems are upheld in IE9+, Firefox, Chrome, Safari, and in Opera 10+.

HSL represents tone, immersion, and daintiness - and speaks to a round and hollow facilitate portrayal of colors.

An HSL shading esteem is indicated with: hsl(hue, immersion, lightness).

Hue is a degree on the shading wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. Immersion is a rate esteem; 0% implies a shade of dim and 100% is the full shading. Delicacy is additionally a rate; 0% is dark, 100% is white.

Example

Define distinctive HSL colors:

#p1 {background-shading: hsl(120, 100%, 50%);}  /* green */
#p2 {background-shading: hsl(120, 100%, 75%);}  /* light green */
#p3 {background-shading: hsl(120, 100%, 25%);}  /* dim green */
#p4 {background-shading: hsl(120, 60%, 70%);}   /* pastel green */

HSLA Colors

HSLA shading esteems are bolstered in IE9+, Firefox 3+, Chrome, Safari, and in Musical drama 10+.

HSLA shading esteems are an expansion of HSL shading esteems with an alpha channel - which determines the darkness of the object.

An HSLA shading esteem is determined with: hsla(hue, immersion, softness, alpha), where the alpha parameter characterizes the mistiness. The alpha parameter is a number between 0.0 (completely straightforward) and 1.0 (completely opaque).

Example

Define distinctive HSL hues with opacity:

#p1 {background-shading: hsla(120, 100%, half, 0.3);}  /* green with darkness */
#p2 {background-shading: hsla(120, 100%, 75%, 0.3);}  /* light green with mistiness */
#p3 {background-shading: hsla(120, 100%, 25%, 0.3);}  /* dim green with darkness */
#p4 {background-shading: hsla(120, 60%, 70%, 0.3);}   /* pastel green with haziness */