<?xml version="1.0" encoding="utf-8"?>

CSS outline and border properties for setting color

CSS outline and border properties for setting color Bad Practice
CSS outline and border properties for setting color Best Practice

For modifying the outline color, web developers can use the shorthand outline property, which lists all outline values (weight, style, and color) separated by gaps or choose the more specific outline-color property.

Since border sides can all be different, you can use the border-color property and, in clockwise order, specify the color for each side.

What value can the color property take?

  • Color name, e.g., yellow
  • HEX code, e.g. #FDC500
  • RGB code, e.g. rgb(253,197,0)
  • HSL - specify a HSL value, like hsl(47, 100%, 50%)
  • Transparent

Top contributors

Stanislau Holadau

Topics

Share

Improve your UX & Product skills with interactive courses that actually work