CSS Border Style

In CSS, you can control the style of an element's border using the border-style property.

The border-style property accepts one or multiple values, and each value represents the style of the border on a particular side of the element. The possible values for border-style are as follows:


You can apply border-style to an element like this:

Try yourself
        
            div {
   border-style: solid;
   width: 200px;
   height: 100px;
}
        
    

This will give the element a solid border on all four sides.


If you want to apply different border styles to different sides of the element, you can use the individual properties for each side: border-top-style, border-right-style, border-bottom-style, and border-left-style.

Try yourself
        
            div {
  border-style: solid; /* All sides */
  border-top-style: dashed; /* Top side */
  border-right-style: dotted; /* Right side */
  border-bottom-style: double; /* Bottom side */
  border-left-style: inset; /* Left side */
  width: 200px;
  height: 100px;
}