Skip to content

Colors

This group includes all properties related to colors.
In CSS, colors can be defined in different ways: color names (red), hexadecimal values (#ff0000), functions (rgb(), hsl(), etc.).


PropertyDescription
colorDefines the text (foreground) color.
background-colorDefines the background color.
border-colorDefines the border color.
border-top-colorDefines the top border color.
border-right-colorDefines the right border color.
border-bottom-colorDefines the bottom border color.
border-left-colorDefines the left border color.
outline-colorDefines the color of the element’s outline.

Some properties were only used in old browsers (Internet Explorer, Netscape) and should no longer be used.

PropertyStatusExplanation
layer-background-colorNetscape 4 (deprecated)Defined the background and border color in Netscape.
scrollbar-base-colorInternet Explorer (deprecated)Defined the main color of the scrollbar.
scrollbar-face-colorInternet Explorer (deprecated)Defined the color of the scrollbar face (center area).
scrollbar-track-colorInternet Explorer (deprecated)Defined the track color of the scrollbar.
scrollbar-arrow-colorInternet Explorer (deprecated)Defined the color of the scrollbar arrows.
scrollbar-shadow-colorInternet Explorer (deprecated)Defined the shadow color of the scrollbar.
scrollbar-darkshadow-colorInternet Explorer (deprecated)Defined the darker outer shadow of the scrollbar.
scrollbar-highlight-colorInternet Explorer (deprecated)Defined the highlight color of the scrollbar.
scrollbar-3dlight-colorInternet Explorer (deprecated)Defined the 3D edge highlight color of the scrollbar.

  • Use only standard properties (color, background-color, border-color, outline-color).
  • Properties related to scrollbars (scrollbar-*) or Netscape (layer-background-color) are deprecated.
  • Today, to customize a scrollbar, use modern CSS pseudo-elements (::-webkit-scrollbar, scrollbar-color, scrollbar-width).