Contact Us | +1 888 239-0733 (Toll free US/CA) Mon-Fri: 7:30am to 4:30pm (PST)

CSS 'border-left' Property Explained

Est. Reading: 1 minute
Posted: April 9, 2024

The CSS 'border-left' property is a shorthand specifying an element's left border's width, style, and color. This property combines three aspects of border styling (width, style, color) for the left side into one declaration, making it easier to read and write CSS related to border styling on the left side of an element.

CSS 'border-left' Property Examples

See the Pen CSS 'border-left' Property by Webzstore (@webzstore) on CodePen.

The 'border-left' property offers a powerful and flexible way to customize the appearance of an element's left border, supporting the creation of visually engaging and distinct designs.

Browser Support For 'border-left' Property

FirefoxSafariChromeMicrosoft EdgeOpera
1.04.01.03.51.0

CSS Syntax of the 'border-left' Property

border-left: width style color | initial | inherit;

Usage of the 'border-left' Property

Utilize 'border-left' to define or alter the appearance of an element's left border. This property is especially useful for creating visually distinct boundaries or accents on the left side of elements within a layout, offering a concise method to simultaneously apply or adjust multiple border characteristics.

Property Values of the 'border-left' Property

  • Width: Specifies the thickness of the border. Acceptable values include length units (e.g., px, em) and predefined thickness keywords (thin, medium, thick).
  • Style: This determines the border's line style (none, solid, dotted, dashed, double, etc.).
  • Color: Sets the border's color using any standard CSS color values (named colors, HEX, RGB(a), HSL(a)).
  • Initial: Resets the 'border-left' to its default value.
  • Inherit: Inherits the 'border-left' from the parent element.

Ryan Parker

Ryan has been a standout in digital marketing since 2010. He's the go-to person for getting businesses noticed online, with over 300 projects under his belt—these range from helping local business owners to big online stores. As the Head of Digital Marketing at his company, Ryan knows all the tricks to make companies shine on the internet. He's excellent at using the latest tech and smart strategies to get results. Ryan is all about making businesses grow and reach more people online.

chevron-down