CSS border-left-color (Set/Change Color of Left Border)

The CSS border-left-color property is used when we need to change the color of left border of an element. For example:

HTML with CSS Code
<!DOCTYPE html>
<html>
<head>
   <style>
      p {border: 4px solid darkgray; padding: 10px; border-left-color: crimson;}
   </style>
</head>
<body>

   <p>This is a para.</p>
   
</body>
</html>
Output

This is a para.

CSS border-left-color Syntax

The syntax of border-left-color property in CSS, is:

border-left-color: x;

The value of x should be any of the following:

  • color - used to define the particular color for the left border
  • transparent - used to define the transparent border
  • initial - used to define the default value
  • inherit - used to inherit the value from its parent

CSS Online Test


« Previous Tutorial Next Tutorial »