43 of 313 menu

The border-top property

The border-top property specifies a color, type, and width for a top border. It is a shorthand property for border-top-width, border-top-style and border-top-color.

Syntax

selector { border-top: width type color; }

The order of the properties does not matter.

Example

Let's give the element a black top border with 2px width:

<div id="elem"></div> #elem { border-top: 2px solid black; background: #f9f9f9; width: 300px; height: 100px; }

:

byenru