CSS border-width

The border-width property in CSS is used to specify the width of the borders of an element. It can be set to a specific value (in pixels, ems, rems, etc.), or to one of the following predefined values: thin, medium, or thick.

When setting the border-width property, you can specify values for all four sides of an element, or you can set different values for each side individually.

Examples:

Result:

    div {
      border: 2px solid black;
    }
  
This is a div element with a border width of 2 pixels.
Result:

    span {
      border-top-width: 1px;
      border-right-width: 2px;
      border-bottom-width: 3px;
      border-left-width: 4px;
      border-style: dashed;
      border-color: red;
    }
  
This is a span element with different border widths for each side.

In the first example, we set the border-width property to 2 pixels for all sides of a div element. In the second example, we set different border widths for each side of a span element, along with a dashed style and red color for the border.