border-left

Summary

The border-left CSS property is a shorthand that sets the values of border-left-color, border-left-style, and border-left-width. These properties describe the left border of elements.

The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.

As with all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that:
  border-left-style: dotted;
  border-left: thick green;

is actually the same as

  border-left-style: dotted;
  border-left: none thick green;

and the value of border-left-style given before border-left is ignored.

Since the default value of border-left-style is none, not specifying the border-style part of the value means that the property specifies its default value which is none and means no border.

  • Initial value the concatenation of the initial values of its longhand properties:
    • border-left-width: medium
    • border-left-style: none
    • border-left-color: currentColor
  • Applies to all elements
  • Inherited no
  • Media visual
  • Computed value as each of the properties of the shorthand:
    • border-left-width: the absolute length or 0 if border-left-style is none or hidden
    • border-left-style: as specified
    • border-left-color: If the value is translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. The transparent keyword maps to rgba(0,0,0,0).
  • Animatable as each of the properties of the shorthand:
    • border-left-color: yes, as a color
    • border-left-style: no
    • border-left-width: yes, as a length
  • Canonical order order of appearance in the formal grammar of the values

Syntax

Formal syntax: <br-width> || <br-style> || <color>

Values

<br-width> 
See border-left-width.
<br-style> 
See border-left-style.
<color> 
See border-left-color.

Examples

element { 
    border-left: 1px solid #000;
}

Specifications

Specification Status Comment
CSS Backgrounds and Borders Module Level 3 Candidate Recommendation No direct changes, though the modification of values for the border-left-color do apply to it.
CSS Level 2 (Revision 1) Recommendation No significant changes
CSS Level 1 Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 1.0 (1.7 or earlier) 4 3.5 1.0 (85)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 1.0 (1.0) (Yes) (Yes) (Yes)

See also

Document Tags and Contributors

Last updated by: kscarfone,
Hide Sidebar