The border-top style property is used to specify the style of the top border.
Syntax:
border-top-style: none | dotted | dashed | solid | groove | inset | outset | ridge | double | hidden | initial | inherit;
Attribute Value: The default value is none.
Property Values
- None: It is the default value and it makes width of the top border to zero. Hence, it is not visible.
Syntax:
border-top-style:none;
Example-1:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: none;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Dotted: It is used to make the top border with a series of dots.
Syntax:border-top-style:dotted;
Example-2:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: dotted;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Dashed: It makes the top border with a series of short line segments.
Syntax:border-top-style:dashed;
Example-3:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: dashed;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Solid: It is used to make the top border with a single solid line segment.
Syntax:
border-top-style:solid;
Example-4:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: solid;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Groove: It makes the top border with a grooved line segment, which makes us feel that it is going inside.
Syntax:
border-top-style:groove;
Example-5:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: groove;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Inset: It makes the top border with an embedded line segment which makes us feel that it is fixed deeply on the screen.
Syntax:
border-top-style:inset;
Example-6:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: inset;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Outset: It is the opposite of inset. It makes the top border with a line segment, which appears it to be coming out.
Syntax:
border-top-style:outset;
Example-7:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: outset;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Ridge: It is the opposite of groove. It makes the top border with a ridged line segment, which makes us feel that it is coming out.
Syntax:
border-top-style:ridge;
Example-8:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: ridge;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Double: It makes the top border with a double solid line. The border width, in this case, is equal to the sum of widths of the two-line segments and the space between them.
Syntax:
border-top-style:double;
Example-9:
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: double;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Hidden: It is used to make the top border invisible, like none, except in case of border conflict resolution of table elements.
Syntax:
border-top-style:hidden;
Example-10
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3.a {border-top-style: hidden;}</style></head><body><h3class="a">GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Initial: It is used to sets the default value of the element.
Syntax:
border-top-style:initial;
Example:11
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3 {border-top-style: initial;}</style></head><body><h3>GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Inherit: It makes the top-border-style property to be inherited from its parent element.
Syntax:
border-top-style:inherit;
Example:12
<!DOCTYPE html><html><head><title>CSS | border-top-style Property</title><style>h3 {border-top-style: inherit;}body {border-top-style: dotted;}</style></head><body><h3>GeeksforGeeks </h3></body></html>chevron_rightfilter_noneOutput:
- Google Chrome
- Edge
- Mozilla Firefox
- Opera
- Safari
- HTML | DOM Style borderTopStyle Property
- CSS | transition-property Property
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | table-layout Property
- CSS | text-align Property
- CSS | border-top-width Property
- CSS | isolation Property
- CSS | border-inline-start-style Property
- CSS | column-rule-width Property
- CSS | word-spacing Property
- CSS | animation-delay Property
- CSS | margin-top Property
- CSS | border radius property
- CSS | grid Property
- CSS | font-size-adjust Property
- CSS | visibility Property
- CSS | Display property
- CSS | grid-template-columns Property
- CSS | height Property
Note: This property is necessary while using border-top property.
Supported Browsers: The browser supported by border-top-style Property are listed below:
Recommended Posts:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

