CSS border-top-style Property Tutorial

In this section, we will learn what the border-top-style property is and how to use it in CSS.

Click here to run the example of border-top-style property.

CSS border-top-style Property Definition and Usage

The border-top-style is a CSS property we use to style the top border of an element.

CSS border-top-style Property Syntax

border-top-style: none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit;

CSS border-top-style Property Value

These are the values we can use for the `border-top-style` property:

  • none (The default value);
  • hidden
  • dotted
  • dashed
  • solid
  • double
  • groove
  • ridge
  • inset
  • outset

Also, the two global values “initial” and “inherit” can be used for this property.

Example: border-top-style property in CSS

See the Pen border-top-style property in CSS by Enjoy Tutorials (@enjoytutorials) on CodePen.

How Does CSS border-top-style Property Work?

In this example, we’ve used the border-top-style to change the style of the top border of the element and set it to ridge style.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies