More “Try it Yourself” examples below.
Definition and Usage
The border-top-style property sets the style of an element’s top border.
| Default value: | none |
|---|---|
| Inherited: | no |
| Animatable: | no. Read about animatable |
| Version: | CSS1 |
| JavaScript syntax: | object.style.borderTopStyle=”dashed” Try it |
CSS Syntax
border-top-style: none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit;
Property Values
| Value | Description |
|---|---|
| none | Specifies no border. This is default |
| hidden | The same as “none”, except in border conflict resolution for table elements |
| dotted | Specifies a dotted border |
| dashed | Specifies a dashed border |
| solid | Specifies a solid border |
| double | Specifies a double border |
| groove | Specifies a 3D grooved border. The effect depends on the border-color value |
| ridge | Specifies a 3D ridged border. The effect depends on the border-color value |
| inset | Specifies a 3D inset border. The effect depends on the border-color value |
| outset | Specifies a 3D outset border. The effect depends on the border-color value |
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
Example
A ridge top border:
div {
border-top-style: ridge;
border-top-color: coral;
border-top-width: 7px;
}
