CSS - border-left-color



Sets the color of an element's left border; default is the color of the element.

Possible Values

  • color − Any valid color value.

Applies to

All the HTML elements.

DOM Syntax

object.style.borderLeftColor = "red";
Always declare the border-left-style or the border-style property before the border-left-color property.

Example

Here is the example which shows effect of this property −

<html>
<head>
   <style>
      p.example1 {border-style: solid;
         border-left-color: rgb(255, 0, 0);
         }
      p.example2 {border-style: solid;
          border-left-color: rgba(255, 0, 0,0.4);
          }
      p.example3 {border-style: solid;
          border-left-color: hsl(0, 100%, 50%);
          }
      p.example4 {border-style: solid;
          border-left-color: hsla(0, 100%, 50%, 0.3);
          }
      p.example5 {border-style: solid;
          border-left-color: transparent;
          }
   </style>
</head>
<body>
      <p class="example1">Left border with RGB color value</p>
      <p class="example2">Left border with RGBA color value</p>
      <p class="example3">Left border with HSL color value</p>
      <p class="example4">Left border with HSLA color value</p>
      <p class="example5">Left border with transparent color value</p>

</body>
</html>
Advertisements