border-left

Description

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

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

Syntax and Property Values


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

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

Example


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

Click to view the demo

The code above generates the following result.

border-left




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference