MDN self-hosted library · e01.org

`border-left-width` CSS property

The border-left-width CSS property sets the width of the left border of an element.

no runnable cells css-property upstream source

The border-left-width CSS property sets the width of the left border of an element.

CSS Demo: border-left-width

```css interactive-example-choice border-left-width: thick;


```css interactive-example-choice
border-left-width: 2em;

```css interactive-example-choice border-left-width: 4px;


```css interactive-example-choice
border-left-width: 2ex;

```css interactive-example-choice border-left-width: 0;


```html interactive-example
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    This is a box with a border around it.
  </div>
</section>

```css interactive-example

example-element {

background-color: palegreen; color: black; border: 0 solid crimson; padding: 0.75em; width: 80%; height: 100px; }


## Syntax

```css
/* Keyword values */
border-left-width: thin;
border-left-width: medium;
border-left-width: thick;

/* <length> values */
border-left-width: 10em;
border-left-width: 3vmax;
border-left-width: 6px;

/* Global keywords */
border-left-width: inherit;
border-left-width: initial;
border-left-width: revert;
border-left-width: revert-layer;
border-left-width: unset;

Values

  • <line-width>
  • : Defines the width of the border, either as an explicit non-negative <length> or the keywords: thin, medium, or thick. The default is medium.

Formal definition

Formal syntax

Examples

Comparing border widths

HTML

<div>Element 1</div>
<div>Element 2</div>

CSS

div {
  border: 1px solid red;
  margin: 1em 0;
}

div:nth-child(1) {
  border-left-width: thick;
}
div:nth-child(2) {
  border-left-width: 2em;
}

Result

100%

Specifications

Browser compatibility

See also

  • The other border-width-related CSS properties: border-top-width, border-right-width, border-bottom-width, and border-width.
  • The other border-left-related CSS properties: border, border-left, border-left-style, and border-left-color.