border top

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

CSS border-top Property


Set the style of the top border:

    border-style: solid;
    border-top: thick double #ff0000;


Definition and Usage

The border-top shorthand property sets all the top border properties in one declaration.

The properties that can be set, are (in order): border-top-width, border-top-style, and border-top-color.

If one of the values above are missing, e.g. border-top:solid #ff0000, the default value for the missing property will be inserted, if any.

CSS Syntax

border-top: border-width border-style border-color|initial|inherit;

Property Values

Value Description
border-top-width Specifies the width of the top border. Default value is "medium"
border-top-style Specifies the style of the top border. Default value is "none"
border-top-color Specifies the color of the top border. Default value is the color of the element