border-top-style
Specifies the style of the top border.
Sample Code
div.test { border-top-style: solid;}
div.test1 { border-top-style: dashed;}
div.test2 { border-top-style: dotted;}
Available Values
| Value | Description |
|---|---|
| none | No border is drawn. The width also becomes 0. This is the initial value. |
| solid | Draws a single solid line border. |
| dashed | Draws a dashed border with larger gaps. |
| dotted | Draws a dotted border with smaller gaps. |
| double | Draws a border with two lines. |
| groove | Draws a border that looks carved in. Opposite of 'ridge'. |
| ridge | Draws a border that looks raised. Opposite of 'groove'. |
| inset | Draws a border that looks embedded. Opposite of 'outset'. |
| outset | Draws a border that looks raised outward. Opposite of 'inset'. |
Browser Preview
<div style="border-top-style: solid; height: 100px; padding: 10px; font-weight: bold;">A div element with height 100px and padding 10px.</div>
Browser Support
Desktop
Supported in all versions
8 ○
7 ○
6 ○
8 and earlier ×Mobile
Android Browser
4.4+ ○
3 and earlier ×Same support as desktop
Same support as desktop
※ Version data based on MDN.
Overview
Specifies the style of the top border.
If no value is set for 'border-top-style', it defaults to 'none'. With 'none', the border width becomes 0 and no border is drawn. To display a top border, you must set 'border-top-style' to a value other than 'none'.
If you find any errors or copyright issues, please contact us.