CSS Property border-left








border-left shorthand property defines the width, color, and style of the left border.

Summary

ItemValue
Initial value not specified
Inherited No.
Version CSS1
JavaScript syntax object.style.borderLeft="5px solid red"
Applies to All elements.




CSS Syntax

border-left: border-width border-style border-color; 

Property Values

The property values are listed in the following table.

Value Description
border-left-width Set the width of the left border
border-left-style Set the style of the left border
border-left-color Set the color of the left border
inherit Inherit the border-left property from the parent element

Browser compatibility

border-left Yes Yes Yes Yes Yes




Example

An example showing how to use border-left CSS property.

<!DOCTYPE HTML>
<html>
    <head>
    <style>
    div {<!--from w  w  w. ja  v  a  2s  .  c o  m-->
        border-left: 1px dashed darkkhaki;
        background: lightyellow;
    }
    </style>
    </head>
    <body>
        <div>java2s.com</div>
    </body>
</html>

Click to view the demo